PROGRAMLAMA
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Mukemmel sayi kotrolü

Aşağa gitmek

Mukemmel sayi kotrolü Empty Mukemmel sayi kotrolü

Mesaj  Admin Ptsi Ağus. 30, 2010 4:01 pm

1-1000 arasından rastgele sayı secılıyor
mukemmel sayımı degılmı kontrol yapılıyor

Kod:

for sayi in range(1,1001):
toplam=1
for i in range(2,(sayi/2)+1):
        if sayi/i*i==sayi:
          toplam==toplam+i
if toplam==sayi:
    print"mükemmel sayidir"
else:
    print"mükemmel sayi değildir"
     

Admin
Admin
Admin

Mesaj Sayısı : 102
Kayıt tarihi : 18/08/10
Yaş : 35

https://programlama.yetkin-forum.com

Sayfa başına dön Aşağa gitmek

Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz