关于函数名带来的问题
#include<stdio.h>int Facsum(int n)
{
int sum = 0;
for (int i = 1; i < n; i++ )
{
if ( n % i == 0 )
sum += i;
}
return sum;
}
int main()
{
int i, flag=0, m, n, sum1;
scanf("%d%d", &m, &n);
for (i = m; i <= n ;i++)
{
sum1 = Facsum(i);
if (i == Facsum(sum1) && i < sum1)
{
printf("%d %d\n",i,sum1); flag++;
}
}
if ( flag == 0) printf("No answer");
return 0;
}
我把函数名大写F改成小写f就对了,不知道为什么,还请大家能为我指指错误