为什么我这个程序执行后没结果?求解答
# include <stdio.h>void main()
{
int i, j, n;
long int sum = 0, temp = 0;
printf("please input a number to n:\n");
scanf("%d", &n);
if(n < 1)
{
printf("n cannot less than 1\n");
return;
for (i = 1; i <= n; i++)
{
temp = 0;
for (j = 1; j <= i; j++)
temp = temp + j;
sum = sum + temp;
}
printf("The sum of sequence(%d) is %d\n", n, sum);
}
}[/b