#include<stdio.h> main() { int a,b; printf("请输入两个整数:\n"); scanf("%d",&a); scanf("%d",&b); if (a>b)printf("较大的数是:%d",a); else printf("较大的数是:%d",b); }
#include <stdio.h> int max(int a, int b) { int c = (a > b) ? a : b; return c; } int main(void) { int a = 12, b = 22; int c = max(a, b); printf("%d", c); return 0; }
[此贴子已经被作者于2019-8-30 11:30编辑过]