Sofya_Soloveva_

Untitled

Jul 6th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. N = int(input())
  2. if len(str(N)) == 2:
  3.     x = N%10
  4.     x1 = N//10
  5.     if x == 0:
  6.         print('Джону',N,'лет')
  7.     elif x1 == 1:
  8.         print('Джону',N,'лет')
  9.     elif x == 1 and x1 != 1:
  10.         print('Джону',N,'год')
  11.     elif x >= 2 and x <=4:
  12.         print('Джону',N,'года')
  13.     elif x >= 5 and x <= 9:
  14.         print('Джону',N,'лет')    
  15. elif len(str(N)) == 1:
  16.     if N == 1:
  17.         print('Джону',N,'год')
  18.     elif N >= 2 and N <=4:
  19.         print('Джону',N,'года')
  20.     elif N >= 5 and N <= 9:
  21.         print('Джону',N,'лет')
Advertisement
Add Comment
Please, Sign In to add comment