只有60分,蒟蒻求救

P1914 小书童——凯撒密码

txr20050504 @ 2019-07-01 22:39:02

// luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
char a[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k'};
char s[100];
int main()
{
    int n;
    cin>>n>>s;
    for(int i=0;i<strlen(s);++i){
        if(s[i]>='a'&&s[i]<='z'){
            for(int j=0;j<=26;++j){
                if(s[i]==a[j]){ cout<<a[j+n];break;}
            }
        }
        else cout<<s[i];
    }
}

by lukelin @ 2019-07-01 22:57:51

@txr20050504 您%一下26啊,不然直接数组爆了,输出空字符了


by lukelin @ 2019-07-01 22:58:21

珂朵莉好评,MC好评


by txr20050504 @ 2019-07-01 23:01:24

@lukelin 。。。qwq


by txr20050504 @ 2019-07-01 23:01:41

@lukelin 蟹蟹


by 智子 @ 2019-07-01 23:02:37

@txr20050504 忽然想起你用的就是emming之前的头像!qwq!


by txr20050504 @ 2019-07-01 23:02:38

@lukelin 我会说头像是当时和emming镜像情头吗


by txr20050504 @ 2019-07-01 23:03:07

@智子 qwq其实是镜像了一下qwq


by lukelin @ 2019-07-01 23:04:12

@txr20050504 但是您说了QAQ


by txr20050504 @ 2019-07-01 23:16:59

@lukelin QAQAQAQAQAQAQ你说出来干嘛


by 4biu @ 2019-07-02 08:55:20

QAQ?


| 下一页