如何使用scanf()输入结束EOF的2个字符串? [英] How to use scanf() for input 2 strings ended of EOF?

查看:406
本文介绍了如何使用scanf()输入结束EOF的2个字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

输入包含两个字符串字母数字ASCII字符,用空格分隔

。输入由EOF终止。

The input contains two strings alphanumeric ASCII characters separated
by whitespace. Input is terminated by EOF.

推荐答案

在文章< 11 ************** *******@m73g2000cwd.googlegroups。 com>,

Alex< ar ****** @ gmail.comwrote:
In article <11*********************@m73g2000cwd.googlegroups. com>,
Alex <ar******@gmail.comwrote:

>输入包含两个字符串字母数字ASCII字符由空格分隔。输入由EOF终止。
>The input contains two strings alphanumeric ASCII characters separated
by whitespace. Input is terminated by EOF.



多好啊。

How nice for it.


Alex写道:
Alex wrote:

输入包含两个字符串字母数字ASCII字符分隔

按空格。输入由EOF终止。
The input contains two strings alphanumeric ASCII characters separated
by whitespace. Input is terminated by EOF.



也许你想看看fgets()和sscanf()?


-

Nick Keighley

maybe you want to look at fgets() and sscanf()?

--
Nick Keighley


Alex写道:
Alex wrote:

输入包含两个字符串字母数字ASCII字符用空格分开

。输入由EOF终止。
The input contains two strings alphanumeric ASCII characters separated
by whitespace. Input is terminated by EOF.



(如果EOF没有终止它,它就不会被称为* E * OF;它似乎有点

多余的说。)


所以输入要求没有行尾字符?这似乎......

不明智。


-

克里斯记得印第安纳3 Dollin

我还在这里,我正在拿着答案 - 卡纳塔克邦,/爱与感情/

(If EOF didn''t terminate it, it wouldn''t be called *E*OF; it seems a bit
redundant to say that.)

So the input is required to have no line-end characters? That seems ...
unwise.

--
Chris "remember Indiana 3" Dollin
"I''m still here and I''m holding the answers" - Karnataka, /Love and Affection/


这篇关于如何使用scanf()输入结束EOF的2个字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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