• + 0 comments
    int base;
    for(int i=0; i<s.size(); i++){
            if(isalpha(s[i])){
                    if(islower(s[i])){
                            base = 'a';
                    }else{
                            base = 'A';
                    }
                    s[i] = ((s[i] - base + k) % 26) + base;
            }
    }
    return s;
    

    }