教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 法律文档 >

C语言笔试--程序改错题(6)

来源:网络收集 时间:2026-09-02
导读: *ps++='+'; if (t /*------------Found Mistake Below------------*/ while(t/10!=0) /////// while(t!=0) { i=t/10; *ps++=t-i*10; t=i; } *ps++='0'+t; *ps='\\0'; /*------------Found Mistake Below-----------

*ps++='+'; if (t<0) { *ps++='-'; t=-t; }

/*------------Found Mistake Below------------*/ while(t/10!=0) /////// while(t!=0) { i=t/10; *ps++=t-i*10; t=i; } *ps++='0'+t; *ps='\\0';

/*------------Found Mistake Below------------*/ }

for(q++;q

gc488.c程序的功能是:读入一个整数n,求sum=1!+2!+3!+...+n!。请指正程

序中的三处错误,使它能得出正确的结果。

注意:不得改变程序的结构和算法,也不能增加或删除程序行。

#include \

long int factorial(int n) {

int i;

long int p=0; /////// p=1 for (i=1;i<=n;i++) p=p*i; return p; }

void main() {

int i,n;

long int sum=0;

scanf(\ /////// &n for (i=1;i<=n;i++)

sum=sum+factorial(n); ///////sum=sum+factorial(i) printf(\

When you are old and grey and full of sleep,

And nodding by the fire, take down this book, And slowly read, and dream of the soft look Your eyes had once, and of their shadows deep; How many loved your moments of glad grace, And loved your beauty with love false or true, But one man loved the pilgrim soul in you, And loved the sorrows of your changing face; And bending down beside the glowing bars, Murmur, a little sadly, how love fled And paced upon the mountains overhead And hid his face amid a crowd of stars.

The furthest distance in the world Is not between life and death But when I stand in front of you Yet you don't know that I love you.

The furthest distance in the world Is not when I stand in front of you

Yet you can't see my love

But when undoubtedly knowing the love from both Yet cannot be together.

The furthest distance in the world Is not being apart while being in love But when I plainly cannot resist the yearning Yet pretending you have never been in my heart. The furthest distance in the world Is not struggling against the tides But using one's indifferent heart To dig an uncrossable river For the one who loves you.

倚窗远眺,目光目光尽处必有一座山,那影影绰绰的黛绿色的影,是春天的颜色。周遭流岚升腾,没露出那真实的面孔。面对那流转的薄雾,我会幻想,那里有一个世外桃源。在天阶夜色凉如水的夏夜,我会静静地,静静地,等待一场流星雨的来临…

许下一个愿望,不乞求去实现,至少,曾经,有那么一刻,我那还未枯萎的,青春的,诗意的心,在我最美的年华里,同星空做了一次灵魂的交流…

秋日里,阳光并不刺眼,天空是一碧如洗的蓝,点缀着飘逸的流云。偶尔,一片飞舞的落叶,会飘到我的窗前。斑驳的印迹里,携刻着深秋的颜色。在一个落雪的晨,这纷纷扬扬的雪,飘落着一如千年前的洁白。窗外,是未被污染的银白色世界。我会去迎接,这人间的圣洁。在这流转的岁月里,有着流转的四季,还有一颗流转的心,亘古不变的心。

…… 此处隐藏:51字,全部文档内容请下载后查看。喜欢就下载吧 ……
C语言笔试--程序改错题(6).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/435931.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)