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

TOP

返回列表