Skip to content

Instantly share code, notes, and snippets.

@wwhhjj
Created November 15, 2011 09:09
Show Gist options
  • Save wwhhjj/1366520 to your computer and use it in GitHub Desktop.
Save wwhhjj/1366520 to your computer and use it in GitHub Desktop.
#include"stdio.h"
main()
{
int i,j;
int sum=0;
printf("1000以内的完全数\n");
for (i=1;i<=1000;i++)
{
for (j=1;j<i;j++)
if (i%j==0)
sum=sum+j;
if (i==sum)
printf("%d\n",i);
sum=0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment