to 3楼:
仅就此题而言,你烦琐了
而且你的 scanf返回值用的不对,如果只读取了两个整数,就会出现bug
#include <stdio.h>
int main(void)
{
int max = 0, n = 0, a = 0, b = 0, c = 0;
if( 1 != scanf("%d", &n) )
return 1;
while( '\n' != (c = getchar()) && EOF != c )
NULL;
while( n-- > 0 )
if( 3 == scanf("%d %d %d", &a, &b, &c) ) {
max = a > b ? a : b;
max = max > c ? max : c;
printf("%d\n", max);
}
else
while( '\n' != (c = getchar()) && EOF != c )
NULL;
return 0;
}
[此贴子已经被作者于2017-8-10 00:45编辑过]