鱼C论坛

 找回密码
 立即注册
查看: 5110|回复: 9

各位大侠、看看这个哪里有问题、

[复制链接]
发表于 2013-1-14 16:59:25 | 显示全部楼层 |阅读模式
1鱼币
int max(int a,int b);
void main()
{
int x,y,z;
int max(int a,int b);
printf("input two numbers;\n");
scanf("%d%d",&x,&y);
z=max(x,y);
printf("maxmum=%d",z);
}
int max(int a,int b)
{
if(a>b)return a;else return b;
}

小甲鱼最新课程 -> https://ilovefishc.com
发表于 2013-1-14 18:07:23 | 显示全部楼层
main()函数中无需再声明max()函数,你这算重载,当然有错!
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2013-1-14 18:53:41 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2013-1-14 19:13:44 | 显示全部楼层
#include<stdio.h>
int max(int a,int b);
void main()
{
        int x,y,z;
        int max(int a,int b);
        printf("input two numbers;\n");
        scanf("%d%d",&x,&y);
        z=max(x,y);
        printf("maxmum=%d",z);
}
int max(int a,int b)
{
        if(a>b)return a;else return b;
}


少了第一句
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2013-1-14 22:02:30 | 显示全部楼层
  1. #include <stdio.h>

  2. int max(int a, int b)

  3. void main()
  4. {
  5.       int x, y, z;
  6.       
  7.       printf("input two numbers;\n");
  8.       scanf("%d%d",&x,&y);

  9.       z=max(x,y);

  10.       printf("maxmum=%d",z);
  11. }
  12. int max(int a,int b)
  13. {
  14.       if(a>b) return a;
  15.       else return b;
  16. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2013-1-15 07:11:03 | 显示全部楼层
本帖最后由 kit1858644 于 2013-1-15 07:14 编辑

沒頭文件? #include <stdio.h>
Maximun打錯字~.~


請善用代碼貼上功能方便閱讀。

小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2013-2-12 20:39:05 | 显示全部楼层
5楼正解。。。
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2013-2-12 23:49:10 | 显示全部楼层
  1. #include<stdio.h>
  2. int max(int a,int b);
  3. void main()
  4. {
  5.         int x,y,z;
  6.         int max(int a,int b);
  7.         printf("input two numbers;\n");
  8.         scanf("%d%d",&x,&y);
  9.         z=max(x,y);
  10.         printf("maxmum=%d",z);
  11. }
  12.         max(int a,int b);
  13. {
  14.         if(a>b)return a;else return b;
  15. }
复制代码
我觉得应该是这样不知道对不对(*^__^*) 嘻嘻……
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2013-2-20 00:02:59 | 显示全部楼层
里面写多了一个int max(int , int)吧
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2013-2-20 18:21:13 | 显示全部楼层
5#正解  。。。。
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-8-9 04:30

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表