2025-03-06 22:45:14 +08:00

22 lines
448 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
功能编写比较a、b两个数的大小且把大者赋给max小者赋给min。
--------------------------------------------------------*/
#include"stdio.h"
main()
{
int a,b,min,max;
printf("输入两个数给a,b:");
scanf("%d,%d",&a,&b);
/**********Program**********/
if (a > b) {
max = a;
min = b;
} else {
max = b;
min = a;
}
/********** End **********/
printf("min=%d,max=%d\n",min,max);
}