Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*-coding: utf-8 -*-
- x = 0
- y = 0
- n = 0
- tr = True
- clad_x = int(input())
- clad_y = int(input())
- storona = input()
- kol = int(input())
- while storona != 'стоп':
- if clad_x == x and clad_y == y:
- tr = False
- if storona == 'север':
- y += kol
- if tr:
- n += 1
- elif storona == 'запад':
- x -= kol
- if tr:
- n += 1
- elif storona == 'юг':
- y -= kol
- if tr:
- n += 1
- elif storona == 'восток':
- x += kol
- if tr:
- n += 1
- storona = input()
- if storona != 'стоп':
- kol = int(input())
- print(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement