开发者

How to print something on screen [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorica开发者_高级运维l and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

The question is how to print something on screen without using variables provided user inputs data but not stored in variable?


I think you were supposed to use the stl copy algorithm:

#include <iterator>
using namespace std;
copy(istream_iterator<string>(cin), istream_iterator<string>(), ostream_iterator<string>(cout, "\n"));

The relevant stl doc is http://www.sgi.com/tech/stl/copy.html


I think you're looking for this.

using namespace std;

cout<<"Enter something: ";
cin>>inputvar;


Start with

putchar(getchar());

then work from there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜