#include <stdio.h>
int main()
{
//Seeking the maximum of two numbers
//int a, b, max;
//printf("please input a,b:\n");
//scanf("%d,%d",&a,&b);
///*max = a;
//if (max < b)max = b;*/
//max = (a > b) ? a : b;
//printf("max = %d\n",max);
//Seeking the maximum of three numbers
/*int a, b, c, max;
printf("please input a,b,c:\n");
scanf("%d,%d,%d",&a,&b,&c);
max = a;
if (max < b)max = b;
if (max < c)max = c;
printf("The largest number is %d\n",max);*/
//Seeking the maximum of ten numbers
int i, a[10], big;
for (i = 0;i < 10;i++)
scanf("%d",&a[i]);
big = a[0];
for (i = 1;i < 10;i++)
if (a[i] > big)big = a[i];
printf("The biggest is %3d\n",big);
return 0;
}
find max number
最新推荐文章于 2019-01-08 05:38:34 发布