2 solutions

  • 0
    @ 2023-9-24 21:45:59

    不用那么复杂 #include <bits/stdc++.h> using namespace std; string ch; int ans; int main() { cin>>ch; for(int i=0;i<ch.size();i++){ ans=int(ch[i])+4; cout<<char(ans); } return 0; }

    • 0
      @ 2023-9-23 12:12:43

      #include<bits/stdc++.h> using namespace std; int main() { //freopen("xinxi.in","r",stdin); //freopen("xinxi.out","w",stdout); string a; getline(cin,a); for(int i=0;i<a.size();i++){ if(a[i]>='A'&&a[i]<='Z'||a[i]>='a'&&a[i]<='z'){ if(a[i]>='A'&&a[i]<='V'||a[i]>='a'&&a[i]<='v') a[i]=a[i]+4; else a[i]=a[i]+('W'-'A'); } }cout<<a; return 0; }

      • 1

      Information

      ID
      402
      Time
      1000ms
      Memory
      64MiB
      Difficulty
      8
      Tags
      # Submissions
      11
      Accepted
      8
      Uploaded By