Created
January 6, 2019 19:31
-
-
Save savolla/4976d35c4ac05c9a7e57fe82ed28d5a6 to your computer and use it in GitHub Desktop.
algoritma final sınavı 3. soru :P
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
int main(void) | |
{ | |
int sayi = 6; | |
int limit = 9999; | |
int toplam = 0; | |
int i; | |
while(sayi < limit) | |
{ | |
toplam = 0; | |
for(i=1; i<sayi; i++) | |
{ | |
if(sayi % i == 0 ) | |
{ | |
toplam += i; | |
} | |
} | |
if(sayi == toplam) | |
{ | |
cout << toplam << endl; | |
} | |
sayi++; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment