a=factorial(n) b=factorial(k) c1=n-k c=factorial(c1) F=a/(b*c) print('F=',F) input()
#53-dars 3-misol
#3.a va b natural sonlar berilgan. a dan b gacha #bо‘lgan sonlar orasidan faqat juftlarini chiqaruvchi #dastur tuzing. Bu yerda a <= b.
a=int(input('a=')) b=int(input("a<="" p="">for a in range(a,b+1): if a%2==0:
print(a) input()
#53-dars 4-misol
#4.n natural soni berilgan. Kvadrati n dan kichik
#bo‘lgan barcha natural sonlarni chiqaruvchi dastur tuzing
from math import* n=int(input('n=')) x=int(sqrt(n))
i=1
while i<=x:
print(i) i+=1
#54-dars 1-mashq
#1. S = 0,5 + 1,5 + 2,5 +…+ 98,5 + 99,5
#ifodani hisoblash dasturini tuzing.
s=0 i=0.5
while i<=100: s=s+i
i+=1
print(s) input()
#54-dars 2-mashq
#2. n natural sonining barcha bo‘luvchilarini #chiqaruvchi dastur tuzing.
n=int(input('n='))
i=0
while i<=n+1:
i+=1
b=n/i
a=n//i
if a==b:
print(i)
print(a) input()
#54-dars 3-misol 1-usul
#3.Kiritilgan n soni qancha raqamdan iborat #ekanligini aniqlovchi dastur tuzing (ko‘rsatma: #n = n%10 ifoda n = 0 bo‘lguncha bajariladi).
n=int(input('n=')) a=len(str(n))
print(n,'soni ',a,' ta raqamdan iborat' ) input()
#54-dars 4-mashq
#4.Kiritilgan n soni raqamlari yig‘indisini #hisoblovchi dastur tuzing.
a=input('a=') n=len(a) a=int(a)
s=0
for i in range(1,n+1): b=a//(10**(i-1))%10 s+=b
print(s) input()
#54-dars 5-mashq
#5.Kiritilgan n soni juft raqamlari sonini #hisoblovchi dastur tuzing.
a = input('Sonni kiriting: ') n = len(a)
a=int(a) j = 0
Do'stlaringiz bilan baham: |