救命!!来自<< c编程语言>>的两个问题 [英] HELP!! Two questions from <<the c programming language>>

查看:74
本文介绍了救命!!来自<< c编程语言>>的两个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

练习1-9。编写一个程序将其输入复制到其输出,

用一个空格替换每个字符串或

多个空格。


练习1-10。编写程序将其输入复制到其输出,

用\t替换每个选项卡,每个

退格由\b,每个反斜杠由\\ 。这使得标签和

退格区以

明确的方式显示。


谁可以发给我代码,非常感谢!我的电子邮件:
ka******@gmail.com

Exercise 1-9. Write a program to copy its input to its output,
replacing each string of one or
more blanks by a single blank.

Exercise 1-10. Write a program to copy its input to its output,
replacing each tab by \t, each
backspace by \b, and each backslash by \\. This makes tabs and
backspaces visible in an
unambiguous way.

Who could sent me the codes, Thanks very much! My email:
ka******@gmail.com

推荐答案

Tak写道:
Tak wrote:

练习1-9。编写一个程序将其输入复制到其输出,

用一个空格替换每个字符串或

多个空格。


练习1-10。编写程序将其输入复制到其输出,

用\t替换每个选项卡,每个

退格由\b,每个反斜杠由\\ 。这使得标签和

退格区以

明确的方式显示。


谁可以发给我代码,非常感谢!我的电子邮件:
ka******@gmail.com



不,这不是它在这里的运作方式。你张贴你的尝试,我们帮助你带来问题。
有问题。我们不做作业。


-

Ian Collins。

No, that''s not how it works here. You post your attempt, we help you
with problems. We don''t do homework.

--
Ian Collins.


Tak写道:
Tak wrote:

练习1-9。编写一个程序将其输入复制到其输出,

用一个空格替换每个字符串或

多个空格。


练习1-10。编写程序将其输入复制到其输出,

用\t替换每个选项卡,每个

退格由\b,每个反斜杠由\\ 。这使得标签和

退格区以

明确的方式显示。


谁可以发给我代码,非常感谢!我的电子邮件:
ka******@gmail.com



/ point / about做练习是/通过做/来学习。如果

你不做这项工作,学习就不会发生,或者也不会发生b $ b。

做好工作。我们可以批评结果,但你必须表现出愿意。


-

JUC 2007,提交: http://hpl.hp.com/conferences/juc2007/submission.html


Hewlett-Packard Limited Cain Road,Bracknell,注册号:

注册办事处:Berks RG12 1HN 690597英格兰

The /point/ about doing the exercises is to /learn by doing/. If
you don''t do the work, the learning doesn''t happen, or doesn''t
happen as well.

Do the work. We can crit the result, but you have to show willing.

--
JUC 2007, submit: http://hpl.hp.com/conferences/juc2007/submission.html

Hewlett-Packard Limited Cain Road, Bracknell, registered no:
registered office: Berks RG12 1HN 690597 England

不,这不是它的工作原理。你发布你的尝试,我们帮你
No, that''s not how it works here. You post your attempt, we help you

有问题。我们不做作业。


-

Ian Collins。
with problems. We don''t do homework.

--
Ian Collins.




不,我认为你是误会。

这不是家庭作业;

我不能锻炼练习1-9。

我的练习1-10的代码是这样的:


#include < stdio.h>


main()

{

char c;


while((c = getchar())!= EOF)

{

if(c ==''\ t'')

printf(" \\t");

else if(c ==''\ b'')

printf(" \\b");

else if(c ==''\\'')

printf(" \\\\\ \\;);

其他

putchar(c);

}

}

我不知道它是否正确?



No, I think you are misunderstanding.
It''s not homework;

I can''t work out Exercise 1-9.
My code of Exercise 1-10 is like this:

#include <stdio.h>

main()
{
char c;

while ((c = getchar()) != EOF)
{
if (c == ''\t'')
printf("\\t");
else if (c == ''\b'')
printf("\\b");
else if (c == ''\\'')
printf("\\\\");
else
putchar(c);
}
}
I don''t know whether it''s right or not?


这篇关于救命!!来自&lt;&lt; c编程语言&gt;&gt;的两个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆