单选题
C语言
题号 #2328932
有以下程序段
int n,t=1,s=0;
scanf("%d",&n);
do{ s=s+t; t=t-2; }while (t!=n);
为使此程序段不陷入死循环,从键盘输入的数据应该是( )
参考答案
D
答案解析
暂无解析
你可能感兴趣的试题
A.7,4,2
B.8,7,5,2
C.9,7,6,4
D.8,5,4,2
A.n=0;
do{++n;}while(n<=0);
do{++n;}while(n<=0);
B.n=0;
while(1){n++;}
while(1){n++;}
C.n=10;
while(n);
while(n);
D.for(n=0,i=1; ;i++) n+=i;
{n--;}
{n--;}