2 solutions

  • 1
    @ 2026-2-3 20:04:30
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin>>n;
        string a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        for(int i=0;i<26;i++)
        {
            cout<<char((a[i]+n-65)%26+65);
        }
    }
    
    • -1
      @ 2025-11-27 11:58:15

      C++ :

      #include <bits/stdc++.h>
      using namespace std;
      
      int main(){
          int n;
          cin>>n;
          string a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
          for(int i=0;i<a.size();++i){
      		cout<<char((a[i]-'A'+n)%26+'A');
      	}
      }
      
      • 1

      Information

      ID
      57
      Time
      1000ms
      Memory
      128MiB
      Difficulty
      9
      Tags
      # Submissions
      13
      Accepted
      5
      Uploaded By