It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center
                            
                        
                    
                
                                已关闭8年。
            
                    
问题是如何在不使用变量的情况下在屏幕上打印某些内容,前提是用户输入了数据但未存储在变量中?

最佳答案

我认为您应该使用stl复制算法:

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


相关的stl doc是http://www.sgi.com/tech/stl/copy.html

关于c++ - 如何在屏幕上打印内容,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5439521/

10-11 00:56