vc++6.0运行以下程序为什么一个能运行一个不能??以下程序可以直接复制到vc++6.0中。谢谢!高分!
错误的#include<stdio.h>main(){intx,y,z,h;printf("输入x=");scanf("%d",&x);if(-5<x&&x<0)z=1;...
错误的
#include <stdio.h>
main()
{int x,y,z,h;
printf("输入x=");
scanf("%d",&x);
if(-5<x&&x<0) z=1;
if(x==0) z=2;
if(0<x&&x<10) z=3;
printf("z是%d\n",z);
switch(z)
{case 1:ptintf("y=%d\n",x);break;
case 2:ptintf("y=%d\n",x-1);break;
case 3:ptintf("y=%d\n",x+1);break;
}
}
正确的
#include <stdio.h>
main()
{int x,y,z,h;
printf("输入x=");
scanf("%d",&x);
if(-5<x&&x<0) z=1;
if(x==0) z=2;
if(0<x&&x<10) z=3;
printf("z是%d\n",z);
switch(z)
{case 1:printf("y=%d\n",x);break;
case 2:printf("y=%d\n",x-1);break;
case 3:printf("y=%d\n",x+1);break;
}
} 展开
#include <stdio.h>
main()
{int x,y,z,h;
printf("输入x=");
scanf("%d",&x);
if(-5<x&&x<0) z=1;
if(x==0) z=2;
if(0<x&&x<10) z=3;
printf("z是%d\n",z);
switch(z)
{case 1:ptintf("y=%d\n",x);break;
case 2:ptintf("y=%d\n",x-1);break;
case 3:ptintf("y=%d\n",x+1);break;
}
}
正确的
#include <stdio.h>
main()
{int x,y,z,h;
printf("输入x=");
scanf("%d",&x);
if(-5<x&&x<0) z=1;
if(x==0) z=2;
if(0<x&&x<10) z=3;
printf("z是%d\n",z);
switch(z)
{case 1:printf("y=%d\n",x);break;
case 2:printf("y=%d\n",x-1);break;
case 3:printf("y=%d\n",x+1);break;
}
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询