编写一个求任意两个整数中最大值的函数,在主函数中输入任意的两个整数,调用该函数,输出最大的数.

学习 时间:2026-05-30 17:20:43 阅读:774
编写一个求任意两个整数中最大值的函数,在主函数中输入任意的两个整数,调用该函数,输出最大的数.

最佳回答

安静的水池

谨慎的猫咪

2026-05-30 17:20:43

#include<stdio。h>int getmax(int a,int b){      return a>b?a:b;}void main(){     int a,b;   printf("input a。b:");   scanf("%d%d",&a,&b);   printf("max=%d\n",getmax(a,b));}

最新回答共有2条回答

  • 可靠的冬天
    回复
    2026-05-30 17:20:43

    #include<stdio。h>int getmax(int a,int b){      return a>b?a:b;}void main(){     int a,b;   printf("input a。b:");   scanf("%d%d",&a,&b);   printf("max=%d\n",getmax(a,b));}

上一篇 我背单词老记不住汉语意思!该怎么办?

下一篇 创维25TI9000彩电行推动供电电阻R301阻值多大?4T30机芯,TMP8829芯片.