返回列表 發帖
本帖最後由 何權晉 於 2024-10-25 19:16 編輯
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. string str;
  4. int n;
  5. int main()
  6. {
  7.     cin>>str>>n;
  8.     char c=str[n];
  9.     if(c>='a')
  10.         c-=32;
  11.     else
  12.         c+=32;
  13.     cout<<"The letter that was selected is: "<<c<<'\n';
  14.     str[n]=c;
  15.     cout<<str;
  16.     return 0;
  17. }
複製代碼

TOP

返回列表