返回列表 發帖

基本輸入與輸出 (二)

使用者輸入中文字串
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     string word;
  6.     cout<<"請輸入要顯示的文字: "<<endl;
  7.     cin>>word;
  8.     cout<<"您輸入的文字是: "<<endl;
  9.     cout<<word<<endl;  
  10.     system("pause");
  11.     return 0;
  12. }
複製代碼

返回列表