How do I convert sscanf and gets into c++ code

cout <<"Enter amount: ";
gets(line);
sscanf(line,"%ld",&amount);