华南理工大学-ACM-PC-2-STL-Primer.pptVIP

  • 1
  • 0
  • 约1.25万字
  • 约 22页
  • 2018-07-06 发布于浙江
  • 举报
String Streams void f(const string s) { // Construct an object to parse strings istringstream is(s); // Vector to store data vectorint v; // Read integer while possible and add it to the vector int tmp; while(is tmp) { v.push_back(tmp); } } string f(const vectorint v) { // Construct an object to do formatted output ostringstream os; // Copy all elements from vectorint to string stream as text tr(v, it) { os *it; } // Get string from string stream string s = os.str(); // Remove first space character if(!s.empty()) {

文档评论(0)

1亿VIP精品文档

相关文档