Psl/stl string
		
		
		
		
		
		
		ไปยังการนำทาง
		ไปยังการค้นหา
		
		
		
		
		
		
		
		
	
ตัวอย่าง 1
#include <iostream>
using namespace std;
main()
{
  string s;
  cin >> s;
  cout << s << endl;
}
ตัวอย่าง 2
รับข้อมูลนำเข้าในรูปแบบ
i string1 i string2 ... x
(i เพิ่ม, x จบการทำงาน) แล้วพิมพ์รายการของ string ที่ได้รับออกมา
#include <iostream>
#include <list>
using namespace std;
main()
{
  string c;
  string s;
  list<string> stlist;
  while(true) {
    cin >> c;
    if(c.compare("i") == 0) {
      cin >> s;
      stlist.push_back(s);
    }
    if(c.compare("x") == 0) {
      break;
    }
  }
  for(auto i = stlist.begin(); i != stlist.end(); i++) {
    cout << *i << endl;
  }
}