Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -"- coding: utf-8 -"-
- print("1) про сенокосилки" )
- q, N = 0, 0
- N = int(input('N сенокосилок '))
- q = int(input('первая отработала,часов '))
- q = q * (1 + (N-1)/6)
- print(' бригада работала,часов '+str(int(q)))
- print(" 2) произведение от 1 до N :")
- N = int(input('факториал N '))
- q = 1
- for i in range(1, N+1) :
- q = q * (1+i/6)
- print( 'факториал '+ str(N) +'! = '+str(q))
- print("3) последовательность :")
- m = []
- m = [-53, 1, 1, 2, 2, 2, 3, 5, 7, 9, 9, 9, 9, 9, 1000]
- print(m)
- n = 0
- q = 1
- N = len(m)
- for i in range(N) :
- p = m.count(m[i])
- if p > 1 and i > 0 and m[i] != m[i-1]:
- n = n + p
- print('одинаковых чисел' + str(m[i])+" " +str(p))
- if m[i] > m[i-1] and i > 0 :
- q = q + 1
- print('всего парных чисел '+str(n))
- print('различных чисел в последовательности '+str(q))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement