Advertisement
Virtual_Universe

Олимпиада : камень ножницы бумага

Sep 19th, 2015
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. fl = open("INPUT.TXT",'r')
  2. fout = open('OUTPUT.TXT', 'w')
  3. st1 = r.readline(0)
  4. st2 = r.readline(1)
  5. pob = "second"
  6. if st1 == "rock" and st2 == "rock":
  7.     pob ="draw"
  8. if st1 == "rock" and st2 == "scissors":
  9.     pob ="first"
  10. if st1 == "rock" and st2 == "paper":
  11.      pob ="second"
  12. #ножницы
  13. if st1 == "scissors" and st2 == "scissors":
  14.     pob ="draw"
  15. if st1 == "scissors" and st2 == "paper":
  16.     pob ="first"
  17. if st1 == "scissors" and st2 == "rock":
  18.     pob ="second"  
  19. #бумага
  20. if st1 == "paper" and st2 == "paper":
  21.     pob ="draw"
  22. if st1 == "paper" and st2 == "rock":
  23.     pob ="first"
  24. if st1 == "paper" and st2 == "scissors":
  25.      pob ="second"
  26. print(pob, file=fout)
  27. fout.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement