蒟蒻 只有0分 怎么回事

P1914 小书童——凯撒密码

SakuraYing @ 2018-10-30 23:04:02

#include <stdio.h>
#include <string.h>
int  main(void)
{   
int count;
char password[51];
scanf_s("%d", &count);
getchar();
gets_s(password, 51);
for (int i = 0;i < strlen(password); i++)
{
    if (25 < count)
        count %= 25;
    if (122 < (password[i] + count))
        password[i] += 'a' + 'z' - password[i] + count;
    else
        password[i] += count;
}
puts(password);

return 0;}

by SakuraYing @ 2018-10-31 09:04:28

没有dalao吗?QAQ


by 灵光一闪 @ 2018-10-31 18:59:42

咱有八十

#include<iostream>
#include<string>
using namespace std;
int main()
{
    int w=0;
    string s;
    int n;
    cin>>n>>s;
    n=n%26;
    for(int i=0;i<s.size();i++)
    {
        char a=s[i]+n;
        if(a>'z')
        {
            w=a-'z'-1;
            a='a'+w;
        }
        w=0;
        cout<<a;
    }
    return 0;
}//可以看看

by 灵光一闪 @ 2018-10-31 18:59:53

@SakuraYing


by SakuraYing @ 2019-03-07 09:09:47

@洛谷亿岁 谢谢 已经AC了


|