鱼C论坛

 找回密码
 立即注册
12
返回列表 发新帖

这段代码哪错了啊

[复制链接]
发表于 2012-11-13 15:19:33 | 显示全部楼层
本帖最后由 愛~の歌聲 于 2012-11-13 15:22 编辑
  1. #include <stdio.h>

  2. int max(int a,int b)
  3. {
  4.         if (a>b)
  5.             return a;
  6.         else
  7.             return b;
  8. }

  9. void main()
  10. {
  11.         int a,b;
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
发表于 2012-11-13 15:37:46 | 显示全部楼层

  1. #include <stido.h>//error #include <stdio.h>才是正确的
  2. #include <math.h>//这个程序的话,这个调用没起到作用

  3. int max(int a,int b);//函数定义多余,下面有一条了
  4. void main()
  5. {
  6.         int x,y,z;
  7.         int max(int a,int b);
  8.         printf("input two numbers:\n");
  9.         scanf("%d%d",&x,&y);
  10.         z=max(x,y);
  11.         printf("maxmum=%d",z);
  12. }

  13. int max(int a,int b)
  14. {
  15.         if (a>b) return a;else ruturn b;
  16. }
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-5-24 14:47

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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