Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- unsigned long e1_v[103],e2_v[103],i,n,j,e1_c[103],e2_c[103];
- char x,y;
- for (i='A';i<='E';i++)
- e1_v[i]=300,e1_c[i]=0;
- for (i='a';i<='e';i++)
- e2_v[i]=300,e2_c[i]=0;
- cin>>n;
- for (j=1;j<=n;j++)
- {
- cin>>x>>y;
- if ('A'<=x&&x<='E')
- {
- e1_c[int(x)]+=e2_v[int(y)];
- e1_v[int(x)]+=50;
- e2_v[int(y)]-=50;
- }
- else
- {
- e2_c[int(x)]+=e1_v[int(y)];
- e2_v[int(x)]+=50;
- e1_v[int(y)]-=50;
- }
- }
- for (i='A';i<='E';i++)
- cout<<(char)i<<" "<<e1_c[i]<<endl;
- for (i='a';i<='e';i++)
- cout<<(char)i<<" "<<e2_c[i]<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement