c语言基础 求解释,调试有一个错误

[复制链接]
查看11 | 回复5 | 2012-3-15 22:39:56 | 显示全部楼层 |阅读模式
#include"stdio.h"//#include"matn.h"int max(int a, int b);void main(){int x,y,z;printf("输入两个整数:\n");scanf("%d %d",&x,&y);z=max(x,y);printf("较大者为:%d",z);}int max(int a,int b){
if(a>b)return a;elsereturn b;}这里不需要用到“math.h”,因为没有用到数学公式,直接注释掉就可以了...
回复

使用道具 举报

千问 | 2012-3-15 22:39:56 | 显示全部楼层
# include"matn.h"中应是math...
回复

使用道具 举报

千问 | 2012-3-15 22:39:56 | 显示全部楼层
# include"matn.h"应该是math.h...
回复

使用道具 举报

千问 | 2012-3-15 22:39:56 | 显示全部楼层
# includevoid main(){int x,y,z;printf("输入两个整数:\n");scanf("%d %d",&x,&y);z=max(x,y);printf("较大者为:%d",z);}int max(int a,int b){
if(a>b)retu...
回复

使用道具 举报

千问 | 2012-3-15 22:39:56 | 显示全部楼层
# include"matn.h"头文件错了...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行