Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int P,n;
- char cod[3],ck[3];
- int main()
- {
- cin>>P;
- cin.get(cod,2);
- cin>>n;
- if(P==1)
- {
- int ns=0,nd=0,nsd=0,nb=0;
- for(int i=1;i<=n;i++)
- {
- cin.get(ck,2);
- cin>>pret;
- int nr=0;
- for(int j=0;j<=2;j++)
- if(cod[i]!=ck[i])
- nr++;
- if(nr==3)
- ns++;
- else
- {
- if(nr==2)
- nsd++;
- else
- {
- if(nr==1)
- nd++;
- else
- if(nr==0)
- nb++;
- }
- }
- }
- cout<<ns<<" "<<nd<<" "<<nsd<<" "nb;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement