返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n;
  7.     char str[50];
  8.     cout<<"請輸入要轉換的英文字母(50字母內)"<<endl;
  9.     cin.getline(str,50);
  10.     cout<<"想讓電腦抓地幾個字母?(50以內)"<<endl;
  11.     cin>>n;
  12.     cout<<"字串第"<<n<<"個字母是"<<str[n-1]<<endl;
  13.     system("pause");
  14.     return 0;
  15. }
複製代碼

TOP

返回列表