源程序如下:
#include<stdio.h>
void main()
{
int i,j,n;
long int sum=0,temp;
char k;
do
{
{
printf("Please input a number to n:\n");
scanf("%d",&n);
if(n<1)
{
printf("The n must be no less than 1!\n");
break;
}
for(i=1;i<=n;i++)
{
temp=0;
for(j=1;j<=i;j++)
temp+=j;
sum+=temp;
}
printf("The sum of the sequence(%d) is %d\n",n,sum);
scanf("%c",&k);
}while(k='y')
}
请问这个程序为什么不能执行printf("The sum of the sequence(%d) is %d\n",n,sum);语句后的scanf("%c",&k);
do while 循环不能实现?该程序在vc下调试通过,但运行有问题