2024-11-03 08:00:32
#include<stdio.h>
void main() { int a,b,c,max,min;
scanf("%d%d%d",&a,&b,&c);
max=min=a;
if ( max<b ) max=b;
if ( max<c ) max=c;
if ( min>b ) min=b;
if ( min>c ) min=c;
printf("最大数%d,最小数%d\n",max,min);
}
2024-11-03 02:57:06
#include <stdio.h>
#define max(a,b,c) (a>b?(a>c?a:c):(b>c?b:c))
#define min(a,b,c) (a<b?(a<c?a:c):(b<c?b:c))
int main() {
int a, b, c;
printf("a=");
scanf("%d", &a);
printf("b=");
scanf("%d", &b);
printf("c=");
scanf("%d", &c);
printf("max=%d, min=%d\n", max(a,b,c), min(a,b,c));
return 0;
}