写一函数,实现求三个整数中得最大值。(要求写出主函数中调用该函数并输出最大值)

来源:百度知道 编辑:UC知道 时间:2024/06/05 03:54:35
是用C语言写的!~~

自己改改~
#include<stdio.h>
#define MAX(X,Y) ((X)>(Y)?(X):(Y))

int main(int argc,char *argv[]){
printf("%d\n",threemax(16,10,9));
return 0;
}

int MaxThreeInt(int a,int b,int c){
return MAX(MAX(a,b),c);
}

  #include<stdio.h>
  #define MAX(X,Y) ((X)>(Y)?(X):(Y))
  int threemax(int a,int b,int c);
  int main(int argc,char *argv[])
  {
  printf("%d\n",threemax(16,10,9));
  return 0;
  }
  int threemax(int a,int b,int c)
  {
  return MAX(MAX(a,b),c);
  }