artemgf

АнтиКАПС

Apr 16th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <string>
  4. #include <math.h>
  5. #include <algorithm>
  6. #include <vector>
  7. #include <set>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.     string s, h = "";
  14.     int i, j;
  15.     bool what = true;
  16.     vector <string> answer;
  17.  
  18.     while (getline(cin, s))
  19.     {
  20.         if(s.size()!=0)
  21.         for (i = 0; i < s.size(); i++)
  22.         {
  23.             if (s[i] == '.' || s[i] == '?' || s[i] == '!')
  24.                 what = true;
  25.             else
  26.                 if (s[i] >= 'A'&&s[i]<='Z')
  27.                     if (what == false)
  28.                         s[i] = s[i] + 32;
  29.                     else
  30.                         what = false;
  31.         }
  32.         answer.push_back(s);
  33.     }
  34.     if(answer.size()!=0)
  35.     for (i = 0; i <= answer.size() - 1; i++)
  36.     {
  37.         cout << answer[i] << endl;
  38.     }
  39.  
  40.     _getch();
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment