| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 783 人关注过本帖
标题:刚学,懂的进来看下
只看楼主 加入收藏
lvh
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2010-8-24
结帖率:0
收藏
已结贴  问题点数:4 回复次数:12 
刚学,懂的进来看下
为什么输入任意俩个数出来的都是4198405,这个数是什么意思.



#include "stdafx.h"


int main(int argc, char* argv[])
{
    int x,y;
    scanf("%d %d",&x,&y);
    int max(int a,int b);
    printf("max=%d\n",max);
    return 1;   
}
int max(int a,int b)
{
    int temp;
    if(a>b)
        temp=a;
    else
        temp=b;
    return temp;
}
搜索更多相关主题的帖子: max include return 
2010-10-17 11:18
自由战士89
Rank: 5Rank: 5
等 级:职业侠客
帖 子:154
专家分:387
注 册:2010-9-2
收藏
得分:0 
#include "stdio.h"
int max(int a,int b);

int main(int argc, char* argv[])
{
    int x,y;
    scanf("%d %d",&x,&y);
    printf("max=%d\n",max(x,y));
    return 1;   
}
int max(int a,int b)
{
    int temp;
    if(a>b)
        temp=a;
    else
        temp=b;
    return temp;
}


[ 本帖最后由 自由战士89 于 2010-10-17 11:50 编辑 ]
2010-10-17 11:23
瓦药墙
Rank: 7Rank: 7Rank: 7
等 级:黑侠
帖 子:218
专家分:556
注 册:2009-9-16
收藏
得分:0 
#include "stdafx.h"


int main(int argc, char* argv[])
{
    int x,y;
    scanf("%d %d",&x,&y);
    int max(int a,int b);
    printf("max=%d\n",max(x, y));
    return 1;   
}
int max(int a,int b)
{
    int temp;
    if(a>b)
        temp=a;
    else
        temp=b;
    return temp;
}

2010-10-17 11:36
瓦药墙
Rank: 7Rank: 7Rank: 7
等 级:黑侠
帖 子:218
专家分:556
注 册:2009-9-16
收藏
得分:0 
max是函数的地址
2010-10-17 11:37
m21wo
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:4
帖 子:440
专家分:1905
注 册:2010-9-23
收藏
得分:0 
头文件改下!就没什么问题了啊
程序代码:
#include <stdio.h>


int main(int argc, char* argv[])
{
    int x,y;
    scanf("%d %d",&x,&y);
    int max(int a,int b);
    printf("max=%d\n",max(x, y));
    return 1;   
}
int max(int a,int b)
{
    int temp;
    if(a>b)
        temp=a;
    else
        temp=b;
    return temp;
}



If You Want Something, Go Get It, Period.
2010-10-17 11:41
wzqsunb
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:57
专家分:130
注 册:2010-10-11
收藏
得分:0 
#include "stdio.h"
 main()
{ int max(int a,int b);
    int x,y;
    scanf("%d %d",&x,&y);
    printf("max=%d\n",max(x, y));
    return 1;   
}
int max(int a,int b)
{
    int temp;
    if(a>b)
        temp=a;
    else
        temp=b;
    return temp;
}
2010-10-17 11:49
狗娃你好吗
Rank: 1
来 自:河南
等 级:新手上路
帖 子:2
专家分:1
注 册:2010-10-17
收藏
得分:0 
#include "stdafx.h"
int max(int a,int b;

 main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    int max(int a,int b);
    printf("max=%d\n",max);
    return 1;   
}
int max(int a,int b)
{
    int temp;
    if(a>b)
        temp=a;
    else
        temp=b;
    return temp;
}
原程序没有函数声明.........

哈哈
2010-10-17 12:10
狗娃你好吗
Rank: 1
来 自:河南
等 级:新手上路
帖 子:2
专家分:1
注 册:2010-10-17
收藏
得分:0 
#include "stdafx.h"
int max(int a,int b);

main()
{
    int x,y,z;
    scanf("%d %d",&x,&y);
    z= max( a, b);
    printf("max=%d\n",z);
   
}
int max(int a,int b)
{
    int temp;
    if(a>b)
        temp=a;
    else
        temp=b;
    return temp;
}
运行程序是上面的

哈哈
2010-10-17 12:13
m21wo
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:4
帖 子:440
专家分:1905
注 册:2010-9-23
收藏
得分:0 
回复 7楼 狗娃你好吗
它的函数声明在主函数里!

If You Want Something, Go Get It, Period.
2010-10-17 12:29
lvh
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2010-8-24
收藏
得分:0 
以下是引用瓦药墙在2010-10-17 11:36:33的发言:

#include "stdafx.h"


int main(int argc, char* argv[])
{
    int x,y;
    scanf("%d %d",&x,&y);
    int max(int a,int b);
    printf("max=%d\n",max(x, y));
    return 1;   
}
int max(int a,int b)
{
    int temp;
    if(a>b)
        temp=a;
    else
        temp=b;
    return temp;
}
int max(int a,int b);   max函数已经声明过了,为什么会调用不成。  
 printf("max=%d\n",max(x, y));为什么把max换成max(x,y)就可以了,
最后一个问题,4198405这个数是什么???
2010-10-17 21:08
快速回复:刚学,懂的进来看下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016234 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved