返回列表 發帖
  1. #include <bits/stdc++.h>

  2. using namespace std;
  3. string str;
  4. int x;
  5. int main()
  6. {
  7.     cin>>str>>x;
  8.     char c=str[x];
  9.     if(c>='a')
  10.     {
  11.         c-=32;
  12.         str[x]=c;
  13.     }else
  14.     {
  15.         c+=32;
  16.         str[x]=c;
  17.     }
  18.     cout<<"The letter that was selected is: "<<c<<endl;
  19.     cout<<str;
  20.     return 0;
  21. }
複製代碼

TOP

返回列表