Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. if (s[z]=='M')
  2. {
  3. if(s[++z]=='M')
  4. {
  5. wynik=wynik+2000;
  6. z=z+2;
  7. }
  8.  
  9. else
  10. {
  11. wynik=wynik+1000;
  12. z=z+1;
  13. }
  14. }
  15.  
  16. if (s[z]=='D')
  17. {
  18. if (s[--z=='C'])
  19. {
  20. wynik=wynik+400;
  21. z=z+1;
  22. }
  23.  
  24. else
  25. {
  26. wynik = wynik +500;
  27. }
  28. z=z+1;
  29.  
  30. }
  31.  
  32.  
  33. if(s[z]=='C')
  34. {
  35. if (s[++z] =='D')
  36. {
  37. wynik = wynik + 400;
  38. z=z+1;
  39. }
  40. else
  41. {
  42. wynik = wynik +100;
  43. z=z+1;
  44.  
  45. }
  46.  
  47.  
  48. }
  49.  
  50. cout<<wynik<<endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement