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

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

这个是错误图片
图片附件: 游客没有浏览图片的权限,请 登录注册

[此贴子已经被作者于2006-7-18 13:59:02编辑过]

搜索更多相关主题的帖子: 图片 include return 
2006-07-18 13:52
飞跃无限
Rank: 1
等 级:新手上路
威 望:1
帖 子:180
专家分:0
注 册:2006-4-16
收藏
得分: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);
}

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

这个是错误图片


看不懂你写的。

2006-07-18 14:00
unicorn
Rank: 4
等 级:贵宾
威 望:14
帖 子:1066
专家分:0
注 册:2005-10-25
收藏
得分:0 

a*b=a;//\"=\"左面能写成这样? 什么语言?
b+1=b;

unicorn-h.spaces. ◇◆ sava-scratch.spaces.  noh enol ! pue pu!w hw u! shemle aq ll!m noh 
2006-07-18 14:00
月影骑士
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-7-18
收藏
得分:0 
你们看错了把
我写的是 a*b=a;
b+1=b;

/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 14:13
nonname1024
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-7-10
收藏
得分:0 
用循环做吧
2006-07-18 14:15
unicorn
Rank: 4
等 级:贵宾
威 望:14
帖 子:1066
专家分:0
注 册:2005-10-25
收藏
得分:0 
以下是引用月影骑士在2006-7-18 14:13:46的发言:
你们看错了把
我写的是 a*b=a;
b+1=b;

语法都没搞明白?
"="是赋值语句,左面只能有一个变量!!


unicorn-h.spaces. ◇◆ sava-scratch.spaces.  noh enol ! pue pu!w hw u! shemle aq ll!m noh 
2006-07-18 14:20
月影骑士
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 14:22
unicorn
Rank: 4
等 级:贵宾
威 望:14
帖 子:1066
专家分:0
注 册:2005-10-25
收藏
得分:0 
是想实现5的阶乘吧...先好好看书吧 把书上的例子运行理解 再自己编 谁都是一步一步过来的
//5!
#include <stdio.h>
main()
{

int i=1,sum=1;
while(i<=5)
{
sum*=i;
i++;
}
printf("5!=%d",sum);
return 0;
}

unicorn-h.spaces. ◇◆ sava-scratch.spaces.  noh enol ! pue pu!w hw u! shemle aq ll!m noh 
2006-07-18 14:30
月影骑士
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 14:34
穆扬
Rank: 1
等 级:禁止发言
帖 子:1910
专家分:0
注 册:2006-6-1
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽

2006-07-18 15:53
快速回复:[求助]新手小问题
数据加载中...
 
   



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

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