2011年计算机二级C语言上机操作题及答案(10)

2014-11-20 16:46:14 · 作者: · 浏览: 22

第10套


填空题


请补充main函数,该函数的功能是:从键盘键盘输入3个整数然后找出最大的数并输出。


例如,输入:12 45 43,输出为45


注意:部分源程序给出如下。


仅在横线上填入所编写的若干表达式或语句,勿改动函数中的其他任何内容。


试题程序:#include


#include


main()


{


int a, b, c, max;


printf("\nInput three numbers:\n");


scanf("%d,%d,%d", &a, &b, &c);


printf("The three numbers are:%d,%d,%d\n", a, b, c);


if (a > b)


___1___;


else


___2___;


if (max < c)


___3___;


printf("max=%d\n", max);


}


第1处填空:max=a


第2处填空:max=b


第3处填空:max=c


编辑特别推荐: