1>.求以下程序的输出结果:
#include<stdio.h>
main()
{ int x=15;
while(x>10 &&x<50)
{ x++;
if(x/3){x++;break;}
else continue;
}
printf("%d\n",x);
}
要求写出详细解答.谢谢!
2>.有以下程序:
#include<stdio.h>
main()
{ char c;
while((c=getchar())!='?')putchar(--c);
}
程序运行时,如果从键盘输入:Y? N?<回车>,则输出结果为:__________.
(此题要求对解答过程进行详细说明,谢谢!)
3>.下面程序的运行结果是:
#include<stdio.h>
main()
{ int a,s,n,count;
a=2;s=0;n=1;count=1;
while(count<=7){n=n*a;s=s+n;++count;}
printf("s=%d",s);
}
(要求写出详细解答.谢谢!)
4>.下面程序的运行结果是:__________.
#include<stdio.h>
main()
{ int y,a;
y=2;a=1;
while(y--!=-1)
{do{a*=y;a++;}while(y--);}
printf("%d,%d",a,y);
}
(要求写出详细解答.谢谢!)
5>.下面程序段的运行结果是:__________.
i=1;s=3;
do{s+=i++;
if(s%7==0)continue;
else ++i;
}while(s<15);
printf("%d",i);
(要求写出详细解答.谢谢!)