Advertisement
STANAANDREY

LOL

Feb 18th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main ()
  5. {
  6.  
  7.  unsigned long e1_v[103],e2_v[103],i,n,j,e1_c[103],e2_c[103];
  8.  char x,y;
  9.  
  10.   for (i='A';i<='E';i++)
  11.     e1_v[i]=300,e1_c[i]=0;
  12.  
  13.  for (i='a';i<='e';i++)
  14.   e2_v[i]=300,e2_c[i]=0;
  15.  
  16.   cin>>n;
  17.   for (j=1;j<=n;j++)
  18.   {
  19.       cin>>x>>y;
  20.       if ('A'<=x&&x<='E')
  21.     {
  22.        e1_c[int(x)]+=e2_v[int(y)];
  23.        e1_v[int(x)]+=50;
  24.        e2_v[int(y)]-=50;
  25.     }
  26.     else
  27.     {
  28.       e2_c[int(x)]+=e1_v[int(y)];
  29.       e2_v[int(x)]+=50;
  30.       e1_v[int(y)]-=50;
  31.     }
  32.   }
  33.  
  34.   for (i='A';i<='E';i++)
  35.   cout<<(char)i<<" "<<e1_c[i]<<endl;
  36.   for (i='a';i<='e';i++)
  37.   cout<<(char)i<<" "<<e2_c[i]<<endl;
  38.  
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement