搜索
查看: 550|回复: 4
打印 上一主题 下一主题

完全按照书上写的,但是现实编译失败

[复制链接]
楼主
发表于 2019-2-15 17:14:50 | 显示全部楼层
#include <stdio.h>
#include <stdlib.h>
int main()
{
      int max4(int a ,int b,int c,int d);
      int a,b,c,d,max;
      printf("pleas enter 4 number;");
      scanf("%d%d%d%d",&a,&b,&c,&d);
          max=max4(a,b,c,d);
      printf("the max = %d\n",max);
      system("pause");
          return 0;
}
   int max4(int a ,int b ,int c ,int d )
{   
    int max2(int a,int b);
    int m;
    m=max2(a,b);
    m=max2(m,c);
    m=max2(m,d);
    return m;
}   
     int max2(int a ,int b)
{  
      if(a>=b)
        return a;
      else
        return b;
}
倒数第九行打错,倒数第八行m不需要括号,倒数第一行没加 }。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表