You are on page 1of 1

#include <cstdlib> #include <iostream> using namespace std; int main() { int n=2; int top=1000000000; int j,suma=0;

while(n<top){ for(j=1;j<n;j++) { if(n%j==0) //cout<<j<<endl; suma+=j; } if(suma==n) cout<<suma<<endl; suma=0; j=0; n++; } system("PAUSE"); return EXIT_SUCCESS; }

You might also like