Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream fin("case.in");
- ofstream fout("case.out");
- int main()
- {
- int g1=0,g2=0,g3=0,f=0,b=0,c=0,i=0,x=0,n=0;
- fin>>n;
- for(i=1;i<=n;i++)
- {
- fin>>x;
- c=c+x%10;
- x=x/10;
- f=f+x%10;
- x=x/10;
- b=b+x%10;
- x=x/10;
- if(x==1)
- g1++;
- if(x==2)
- g2++;
- if(x==3)
- g3++;
- }
- fout<<g1<<endl<<g2<<endl<<g3<<endl<<b<<endl<<f<<endl<<c;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement