编写一C语言程序,从键盘输入10个整数,求出它们中最大的一个数并输出。(请不要使用数组或指针)。
输入要求:每输入一个整数前,要有提示信息”input the number!\n”
输出要求:”max integer is %d!\n”
#include <stdio.h>
main()
{
int i,x,max;
printf("input the number!\n");
scanf("%d",&x);
max=x;
for(i=1;i<=9;i++)
{
printf("input the number!\n");
scanf("%d",&x);
if(max<x)max=x;
}
printf("max integer is %d!\n",max);
}
运行截图

本站原创文章,作者:小 编,如若转载,请注明出处:https://www.mzbky.com/793.html
微信扫一扫
支付宝扫一扫