Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int n,kiek[4],fin[4],r;
- string g,s[4],sk[4];
- s[0]="a",s[1]="a",s[2]="a",s[3]="a";
- fin[0]=0,fin[1]=0,fin[2]=0,fin[3]=0;
- cin>>n;
- for(int i=0;i<n;i++)
- {
- cin>>g;
- if(s[0]=="a" || s[0]==g)
- {
- s[0]=g;
- cin>>kiek[0];
- if(kiek[0]==15){fin[0]+=21;}
- if(kiek[0]==0)
- {
- cin>>sk[0];
- if(sk[0]=="ff"){fin[0]+=255;}
- }
- }
- else if((s[0]!=g && s[1]=="a") || s[1]==g)
- {
- s[1]=g;
- cin>>kiek[1];
- if(kiek[1]==15){fin[1]+=21;}
- if(kiek[1]==0)
- {
- cin>>sk[1];
- if(sk[1]=="ff"){fin[1]+=255;}
- }
- }
- else if((s[0]!=g && s[1]!=g && s[2]=="a") || s[2]==g)
- {
- s[2]=g;
- cin>>kiek[2];
- if(kiek[2]==15){fin[2]+=21;}
- if(kiek[2]==0)
- {
- cin>>sk[2];
- if(sk[2]=="ff"){fin[2]+=255;}
- }
- }
- else if((s[0]!=g && s[1]!=g && s[2]!=g && s[3]=="a") || s[3]==g)
- {
- s[3]=g;
- cin>>kiek[3];
- if(kiek[3]==4){fin[3]+=4;}
- if(kiek[3]==15){fin[3]+=21;}
- if(kiek[3]==0){
- cin>>sk[3];
- if(sk[3]=="ff"){fin[3]+=255;}
- }
- }
- }
- //isvedam atsakyma
- for(int y=0;y<4;y++)
- {
- if(s[y]!="a" && s[y]!="ff")
- {
- cout<<s[y];
- if(fin[y]==765){cout<<" 2fd"<<endl;}
- else if(fin[y]==510){cout<<" 1fe"<<endl;}
- else if(fin[y]==42){cout<<" 2a"<<endl;}
- else if(fin[y]==12){cout<<" c"<<endl;}
- else{cout<<endl;}
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement