有人可以帮忙把这个程序编辑完整么 万分感谢
/* a program that compute perfect numbers *//*
perfect number is a number who factors adds up to itself.
For example; 6
factors are 1, 2, 3 and 1 + 2 + 3 = 6
Another example : 28
factors are: 1, 2, 4, 7, 14
and 1 + 2 + 4 + 7 + 14 = 28
This ia program that find 6 perfect numbers
*/
#include <stdio.h>
#define S 1 /* Starting Number */
#define N 6 /* Number of perfect number to find */
#define WRITEONLY "w"
FILE *fp;
long p = S;
main( argc, argv )
int argc ;
char *argv[ ] ;
{
long f,sum;
int c = 1;
if(argc == 2)
{
if ((fp=fopen(argv[1], WRITEONLY)) == NULL)
{
printf("%s: cannot open %s\n", argv[0], argv[1]);
exit(1);
}
} else fp = stdout ;
/****
Logic is missing here!
***/
}