tc2中怎么比较两个数的大小
来源:百度知道 编辑:UC知道 时间:2024/05/30 08:25:56
#include <stdio.h>
int main()
{ int a,b;
scanf("%d,%d".&a,&b);
printf("%d",a>b?a:b);
return 0;
}
用数学中的 > <就行.
也能用>= <=,这和数学里有些不同(大于等于,小于等于)
UC知道是一部内容开放、自由的互动网络百科全书
客观、专业、权威的知识性百科全书
来源:百度知道 编辑:UC知道 时间:2024/05/30 08:25:56
#include <stdio.h>
int main()
{ int a,b;
scanf("%d,%d".&a,&b);
printf("%d",a>b?a:b);
return 0;
}
用数学中的 > <就行.
也能用>= <=,这和数学里有些不同(大于等于,小于等于)