Untitled

mail@pastecode.io avatar
unknown
plain_text
19 days ago
309 B
2
Indexable
Never
#include <iostream>
#include <string>
using namespace std;
int main()
{
    string a;
    cin>>a;
    int k;
    cin>>k;
    int l=a.length();
    for(int i=0; i<l; i++){
        if(a[i]-k<65) {a[i]=90-(65-(a[i]-k))+1;/*cout<<a<<endl;*/}
        else {a[i]-=k;/*cout<<a<<endl;*/
        }
    }
    cout<<a;
}
Leave a Comment