Advertisement
a53

LOL

a53
Jan 23rd, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n,X,Y,V[10]={300,300,300,300,300,300,300,300,300,300},C[10]={0};
  7. char x,y;
  8. cin>>n;
  9. while(n--)
  10. {
  11. cin>>x>>y;
  12. if(x>='A'&&x<='E')
  13. X=x-65;
  14. else
  15. X=x-97+5;
  16. if(y>='A'&&y<='E')
  17. Y=y-65;
  18. else
  19. Y=y-97+5;
  20. C[X]+=V[Y];
  21. if(V[X]+50>=1000)
  22. V[X]=1000;
  23. else
  24. V[X]+=50;
  25. if(V[Y]>=50)
  26. V[Y]-=50;
  27. else
  28. V[Y]=0;
  29. }
  30. for(int i=0;i<5;++i)
  31. cout<<(char)(i+65)<<' '<<C[i]<<'\n';
  32. for(int i=5;i<10;++i)
  33. cout<<(char)(i+97-5)<<' '<<C[i]<<'\n';
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement