SHARE
TWEET

Untitled

a guest Nov 19th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <fstream>
  2. using namespace std;
  3. ifstream fin("case.in");
  4. ofstream fout("case.out");
  5. int main()
  6.  
  7. {
  8.     int g1=0,g2=0,g3=0,f=0,b=0,c=0,i=0,x=0,n=0;
  9.    fin>>n;
  10.    for(i=1;i<=n;i++)
  11.    {
  12.     fin>>x;
  13.        c=c+x%10;
  14.        x=x/10;
  15.        f=f+x%10;
  16.        x=x/10;
  17.        b=b+x%10;
  18.        x=x/10;
  19.        if(x==1)
  20.         g1++;
  21.        if(x==2)
  22.         g2++;
  23.        if(x==3)
  24.         g3++;
  25.  
  26.    }
  27.    fout<<g1<<endl<<g2<<endl<<g3<<endl<<b<<endl<<f<<endl<<c;
  28.     return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top