Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上我要做的是在给定字符串的单词之间平均分配空格。这就是我所做的:
istringstream s("En el infinito y mas alla"); string token; while( s >> token ) { cout << token << setw(10); }
但是,这并没有按预期工作。有人知道为什么吗?
可能这就是你想要的?
cout<< setw(10+token.size()) << token ;