Advertisement
NurAliya

ц 402

Dec 3rd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n;
  7.     cin >> n;
  8.     int kol = 0,u=0;
  9.     string s;
  10.     cin.ignore();
  11.     for (int i = 0; i<n; i++)
  12.     {      
  13.         getline(cin, s);
  14.         int g = 0;
  15.         int q = 0;
  16.         for (int y = 0; y<s.length() - 1; y++)
  17.         {
  18.             string s1 = "..";
  19.             if (s.compare(y, 2, s1) == 0)
  20.                 g++;
  21.             if (s[y] == '@') u++;
  22.         }
  23.         if ((u>1)||(s[0] == '@') || (s[s.length() - 1] == '@')) q++;
  24.         if ((g == 0) && (q == 0))
  25.         {
  26.             kol++;
  27.         }
  28.         s.erase(0, s.length() - 1);
  29.     }
  30.     cout << kol << endl;
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement