//_9_if判断语句
//_9_main.cpp
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x,y,z,mid,dec;
printf("please input three integer:\n");
scanf("%d %d %d",&x,&y,&z);
if(x<y)
{
mid = x; x = y; y = mid;
}
if(x<z)
{
mid = x; x = z; z = mid;
}
if(y<z)
{
mid = y; y = z; z = mid;
}
printf("输入一个整数,程序根据其正负判断输出:\n");
scanf("%d",&dec);
if(dec >= 0)
printf("最大整数为:%d\n",x);
else
printf("最小整数为:%d\n",z);
system("pause");
return 0;
}
9_if判断语句
最新推荐文章于 2022-09-26 10:48:50 发布