Advertisement
Sofya_Soloveva_

Untitled

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