#includeint main(void){int y,a;y=2,a=1;while(y--!=-1){do{a*=
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/13 14:35:31
#include
int main(void)
{
int y,a;
y=2,a=1;
while(y--!=-1)
{do{a*=y;a++;}while(y--);}
printf("%d,%d\n",a,y);
}
为什么运行出来是1 -2
我纠结了很久还是-1 -2
int main(void)
{
int y,a;
y=2,a=1;
while(y--!=-1)
{do{a*=y;a++;}while(y--);}
printf("%d,%d\n",a,y);
}
为什么运行出来是1 -2
我纠结了很久还是-1 -2
/*试一下这个吧,试着把程序中的变化打印出来.内层循环只在第一次外循环时进行,当第一次内循环结束后外循环才会继续,而且内循环在之后,y=-1,外循环也不再进行,直接退出.*/
#include
int main(void)
{
int y,a,i;
i=1,y=2,a=1;
printf("%before all,a = %d,y = %d\n",a,y);
while(y--!=-1)
{
printf("first while begin,a = %d,y = %d\n",a,y);
do
{
printf("\t%dst dowhile begin,\ta = %d,y = %d\n",i,a,y);
a*=y;
a++;
printf("\t%dst dowhile end,\ta = %d,y = %d\n",i,a,y);
i++;
}
while(y--);
printf("first while end,a = %d,y = %d\n",a,y);
}
printf("%d,%d\n",a,y);
//getchar();
}
#include
int main(void)
{
int y,a,i;
i=1,y=2,a=1;
printf("%before all,a = %d,y = %d\n",a,y);
while(y--!=-1)
{
printf("first while begin,a = %d,y = %d\n",a,y);
do
{
printf("\t%dst dowhile begin,\ta = %d,y = %d\n",i,a,y);
a*=y;
a++;
printf("\t%dst dowhile end,\ta = %d,y = %d\n",i,a,y);
i++;
}
while(y--);
printf("first while end,a = %d,y = %d\n",a,y);
}
printf("%d,%d\n",a,y);
//getchar();
}
#includeint main(void){int y,a;y=2,a=1;while(y--!=-1){do{a*=
#includeint main(void){int x,y,t,n,flag=1,s,i;while( scanf("
#include main() {int y,a; y=2,a=1; while(y--!=-1) {do{a*=y;a
#include void f(int*x,int y) {*x=y+1;y=*x+2;} main() {int a=
#includeint a(int x);int b(int y);int main(){int m,n;n=6;m=a
#include void main() { int y=10; do{ y--; } while(--y); prin
#includeint f(int a);void main(){\x05int i=5,a;\x05a=i++==--
#include void main(void) { int a=
main() {int a=10,y=0; do{ a+=2;y+=a; if(y>50)break; }while(a
#include Int main(void ) { int a = 5,b = 4,x,y; x = 2 * a++
这个程序语法的错误 #include void main(){int x ,y ;char x='A';int y='A
# include void p(int *x,int y){ ++*x; y=y+2; } void main() {