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

TOP

返回列表