Advertisement
Guest User

nigga killa

a guest
May 22nd, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1.  
  2. #include <string>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. void end();
  8.  
  9. int main()
  10. {
  11.     string input;
  12.  
  13.  
  14.  
  15.     cout << "Enter a sentence with numbers or no number it's up to you? \n"
  16.         << "I'll find any integer number used on your sentace.\n";
  17.     getline(cin, input);
  18.  
  19.     cout << "Your input was: \n" << input << endl;
  20.  
  21.     for (int i = 0; input.length() > i; i++)
  22.     {
  23.         if (input[i] == 'X')
  24.             input[i] = '^';
  25.     }
  26.  
  27.  
  28.     for (int i = 0; input.length() > i; i++)
  29.     {
  30.         if (isdigit(input[i]))
  31.         {
  32.             if ((input[i - 1] == ' ') || (input[i - 1] == 'X'))
  33.             {
  34.                 input[i] = 'X';
  35.             }
  36.         }
  37.     }
  38.    
  39.     for (int i = 0; input.length() > i; i++)
  40.     {
  41.         if (input[i] == '^')
  42.             input[i] = 'X';
  43.     }
  44.     cout <<"Output: \n"<< input<< endl;
  45.    
  46.     end();
  47.  
  48.     return 0;
  49. }
  50.  
  51. void end()
  52. {
  53.     char letter;
  54.     cout << "Enter to a key to end the program: ";
  55.     cin >> letter;
  56. }
  57. bitch ni
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement