| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1359 人关注过本帖
标题:[求助]新手小问题
只看楼主 加入收藏
月影骑士
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-7-18
收藏
得分:0 

我是高二,自己买书,自学的.


/priest_ms/58701079/1603639243.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://img503.photo./priest_ms/58701079/1603639243.jpg');}" onmousewheel="return imgzoom(this);" alt="" />
2006-07-18 16:34
穆扬
Rank: 1
等 级:禁止发言
帖 子:1910
专家分:0
注 册:2006-6-1
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽

2006-07-18 16:43
nonname1024
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-7-10
收藏
得分:0 
把a*b=a;
b+1=b;
反过来还有点门道,就是不能运行
2006-07-18 17:28
月影骑士
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-7-18
收藏
得分:0 

我在潭的书上看到, S3:使A*B,乘积仍放在变量A中,可表示为A*B=>A
就是这个意思


/priest_ms/58701079/1603639243.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://img503.photo./priest_ms/58701079/1603639243.jpg');}" onmousewheel="return imgzoom(this);" alt="" />
2006-07-18 17:30
穆扬
Rank: 1
等 级:禁止发言
帖 子:1910
专家分:0
注 册:2006-6-1
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽

2006-07-18 17:37
月影骑士
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-7-18
收藏
得分:0 
知道了,谢谢帮忙,

/priest_ms/58701079/1603639243.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://img503.photo./priest_ms/58701079/1603639243.jpg');}" onmousewheel="return imgzoom(this);" alt="" />
2006-07-18 17:46
月影骑士
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-7-18
收藏
得分:0 
#include <stdio.h>
main()
{
int a=1,b=1,sum;
while (b<=5)
{
a*=b;
b++;
}
printf("This number is %d\n",sum);
return (sum);
我把这个算出来了是 65536→错的!
请问要如何修改才能把值赋给 SUM?

/priest_ms/58701079/1603639243.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://img503.photo./priest_ms/58701079/1603639243.jpg');}" onmousewheel="return imgzoom(this);" alt="" />
2006-07-18 18:03
穆扬
Rank: 1
等 级:禁止发言
帖 子:1910
专家分:0
注 册:2006-6-1
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽

2006-07-18 18:09
★红狼
Rank: 2
等 级:论坛游民
帖 子:190
专家分:17
注 册:2006-7-12
收藏
得分:0 
以下是引用月影骑士在2006-7-18 13:52:43的发言:
问题 1X2X3X4X5

我的解答是:
#include <stdio.h>
main()
{
int a,b;
a=1;b=2;
a*b=a;
b+1=b;
if(b>5) b=5;
return (b);
printf("THE RESULT is %d\n",b);
}

运行有错误,请大家不吝指教.

这个是错误图片

你好象是想用递归;

那么:fun(int n)
{
int sum;
if(n>0) sum=n*fun(n-1);
else sum=1;
return sum;
}
main()
{
int b=5;
trintf("%d",fun(b))
}

是这样吧。

我不知道。在主函数 main()里面 返回 sum 是什么意思?有什么用?还有不是在return 或 exit(0).过后。后面的还会执行么?
那么return 后面的 语句有什么用?

2006-07-18 18:27
lxgaaa
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2006-5-17
收藏
得分:0 
楼上正解

天高任鸟飞,海阔任鱼翱
2006-07-18 19:11
快速回复:[求助]新手小问题
数据加载中...
 
   



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

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