Skip to content

Instantly share code, notes, and snippets.

@savolla
Created January 6, 2019 19:31
Show Gist options
  • Save savolla/4976d35c4ac05c9a7e57fe82ed28d5a6 to your computer and use it in GitHub Desktop.
Save savolla/4976d35c4ac05c9a7e57fe82ed28d5a6 to your computer and use it in GitHub Desktop.
algoritma final sınavı 3. soru :P
#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