DALAO,本蒟蒻只有80分(╥╯^╰╥)

P1914 小书童——凯撒密码

Genshineer @ 2019-07-12 20:10:50

#include<bits/stdc++.h>
using namespace std;
char a[27]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
int n;
string s;
int main()
{
    cin>>n>>s;
    n%=26;
    for(int i=0;i<=s.size();i++)
    {
        for(int j=0;j<26;j++)
        {
            if(s[i]==a[j])
                cout<<a[j+n];
        }
    }
    return 0;
}

by 听枫 @ 2019-07-12 20:14:31

这头像……kkk要来了


by 鬼毅 @ 2019-07-12 20:15:00

前排滋滋


by Genshineer @ 2019-07-12 20:19:39

滋滋滋滋滋滋滋滋滋


by    吾皇 @ 2019-07-12 20:20:03

j+n可能会大于26?


by 花园Serena @ 2019-07-12 20:32:02

@   吾皇 嗯嗯好像是的


by    吾皇 @ 2019-07-12 20:34:45

嗯嗯


by Genshineer @ 2019-07-12 20:55:06

26 qwertyuiopasdfghjklzxcvbnm


by Genshineer @ 2019-07-12 20:55:40

25 abcxyz


|