Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. ifstream f("pufu.in");
  4. ofstream g("pufu.out");
  5. int t,n,c=0,ca=0,s=0;
  6. int main()
  7. {
  8.     f >> t;
  9.     while (t--)
  10.     {
  11.         f >> n;
  12.         char x[10] = "";
  13.         for (int i=1; i<=n ; i++)
  14.         {
  15.             f >> x;
  16.             if (x[0] == 'c' && x[1] == 'i') c++;
  17.             else if (x[0]=='c' && x[1] == 'a') ca++;
  18.             else  s++;
  19.             char x[10]="";
  20.         }
  21.  
  22.     }
  23.     g << c << " " << ca << " " << s;
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement