Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. # -"- coding: utf-8  -"-
  2. print("1) про сенокосилки" )
  3. q, N = 0, 0
  4. N = int(input('N сенокосилок '))
  5. q = int(input('первая отработала,часов '))
  6. q = q * (1 + (N-1)/6)
  7. print(' бригада работала,часов '+str(int(q)))
  8. print(" 2) произведение от 1 до N :")
  9. N = int(input('факториал N '))
  10. q = 1
  11. for i in range(1, N+1) :
  12.     q = q * (1+i/6)
  13. print( 'факториал '+ str(N) +'! = '+str(q))
  14. print("3) последовательность :")
  15. m = []    
  16. m = [-53, 1, 1, 2, 2, 2, 3, 5, 7, 9, 9, 9, 9, 9, 1000]
  17. print(m)
  18. n = 0
  19. q = 1
  20. N = len(m)
  21. for i in range(N) :
  22.     p = m.count(m[i])
  23.     if p > 1  and i > 0 and m[i] != m[i-1]:
  24.         n = n + p    
  25.         print('одинаковых чисел' + str(m[i])+" " +str(p))
  26.     if  m[i] > m[i-1] and i > 0 :
  27.         q = q + 1  
  28. print('всего парных чисел '+str(n))
  29. print('различных чисел в последовательности '+str(q))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement