Advertisement
T-D-K

Untitled

Apr 10th, 2018
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. //p1
  2. n = int(input())
  3. a = 30001
  4. for i in range(n):
  5.     b = input()
  6.     if b[len(b) - 1] == "4" and a > int(b):
  7.         a = int(b)
  8. print(a)
  9.  
  10. //p2
  11. for i in range(10, 100):
  12.     a = i//10
  13.     b = i%10
  14.     if i==2*a*b:
  15.         print(i)
  16.  
  17. //p3
  18. import math;
  19. x = float(input())
  20. n = int(input())
  21. a = 0.0
  22. for i in range(0, n + 1):
  23.     b =(-1)**(i)*(x**(2*i+1))/math.factorial(2*i+1)
  24.     a = a + b
  25. print(a)
  26.  
  27. //p4
  28. m,n = map(int, input().split())
  29. for i in range(m,n+1):
  30.     b = 0
  31.     for q in range(1, i + 1):
  32.         if i % q == 0:
  33.             b = b + q
  34.     print(str(i)+": "+str(b))
  35.  
  36. //p5
  37. n = int(input())
  38. for i in range(n, 0, -1):
  39.     a = ""
  40.     for q in range(i):
  41.         a = a + "1"
  42.     print(a)
  43.  
  44. //p6
  45. n = int(input())
  46. for i in range(n + 1, n*2+1):
  47.     for q in range(2, i):
  48.         if i % q == 0:
  49.             break
  50.     else:
  51.         print(i)
  52.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement