C视频例题4.11,的其它方法.
/*输入三个整数,输出最大数和最小数*/#include <stdio.h>
void main()
{
int a, b, c, max, min;
printf("please input three number: ");
scanf("%d%d%d", &a, &b, &c);
max = a>(b>c ? b : c) ? a : (b>c ? b : c);
min = a<(b<c ? b : c) ? a : (b<c ? b : c);
printf("max = %d, min =%d\n", max, min);
}
:victory:good
感谢楼主无私奉献!
页:
[1]