返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<string>
  4. using namespace std;
  5. int main()
  6. {
  7.     string sen;
  8.     cout<<"請輸入一段字串:";
  9.     getline(cin,sen);
  10.     cout<< sen<<endl;
  11.     cout<<"本字串為:"<<sen.size()<<"個字元"<<endl;
  12.    
  13.    
  14.     system("pause");
  15.     return 0;
  16. }
複製代碼

TOP

返回列表