标题:关于函数(相同变量做参数比较的问题)
取消只看楼主
primary
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2005-9-9
 问题点数:0 回复次数:0 
关于函数(相同变量做参数比较的问题)

#include<iostream> #include<iomanip> using namespace std; int f(int a,int b) { int c; if(a<b) c=1; else if(a==b) c=0; else c=-1; return(c); }

int main(void) { int n=2,x,p; p=f(n,++n); cout<<p<<endl; return 0; } 大家猜猜结果是多少呢???? 并告诉我:为什么你会认为是这个答案呢?

搜索更多相关主题的帖子: 变量 函数 参数 
2005-10-17 22:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-30463-1-1.html




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

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