fork download
  1. #include<iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string input;
  9. int n,m;
  10. cout<<"Enter a student's name, social security number, user id, and password in one line:";
  11. getline(cin,input);
  12.  
  13. n=input.find(' ',0);
  14. input.replace(n+1,7,"xxx-xx-xxxx");
  15. n=input.find(' ',n+13)+1;
  16. m=input.length();
  17. m=m-n;
  18. input.erase(n,m);
  19. input.insert(n,m,'x');
  20. cout<<"changed: "<<input<<endl;
  21. system("pause");
  22. return 0;
  23. }
Success #stdin #stdout #stderr 0s 15240KB
stdin
Standard input is empty
stdout
Enter a student's name, social security number, user id, and password in one line:changed: xxxxxxxxxxx
stderr
sh: 1: pause: not found