Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. days=int(input())
  2. money=0
  3. sum=0
  4. gameW=0
  5. gameL=0
  6. current=0
  7.  
  8. for i in range(days):
  9.     for j in range(20):
  10.         sport=input()
  11.         if(sport=="Finish"):
  12.             break
  13.            
  14.         result=input()
  15.         if(result=="win"):
  16.             money+=20
  17.             gameW+=1
  18.         elif(result=="lose"):
  19.             money+=0
  20.             gameL+=1
  21.     if(gameW>=gameL):
  22.         current=money+money*0.1
  23.        
  24.        
  25.     else:
  26.         current=money
  27.        
  28.    
  29.  
  30.  
  31. if(gameW>gameL):
  32.     total=current*1.2
  33.     print(f'You won the tournament! Total raised money: {total:.2f}')
  34. else:
  35.     total=current
  36.     print(f'You lost the tournament! Total raised money: {total:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement