一个帮忙魔芋AC的

P1914 小书童——凯撒密码

FOREIGN @ 2019-06-29 22:46:44

#include<bits/stdc++.h>
using namespace std;
string s;
int n,i,j;
int main()
{
cin>>n;
cin>>s;
for(i=0;i<s.size();++i)
{
    for(j=1;j<=n;++j)
    {
        ++s[i];
        if(s[i]>'z')
        s[i]='a';
    }
}
cout<<s;
return 0;
}
呵呵,

by charliegong @ 2019-06-29 22:50:26

include<iostream>

include<cstring>

#include<algorithm>
#include<stdio.h>
using namespace std;
char a[1000]={0};
int main()
{
    int i,j,n;
    scanf("%d",&n);
    scanf("%s",a);
    n=n%26;
    for(int i=0;i<strlen(a);i++)
    {
        a[i]=(a[i]-'a'+n)%26+'a';
    }
    cout<<a;
    return 0;
}

by charliegong @ 2019-06-29 22:51:18

一个魔芋帮忙魔芋wa的qwq


by charliegong @ 2019-06-29 22:53:47

@レム、㍕


by charliegong @ 2019-06-29 22:55:13

我连你的名字都不会打,我也是弱得掉渣了qwq


by FOREIGN @ 2019-06-29 22:56:34

@charliegong 呵呵,正常啊 レム、㍕本来就不是中文啊


|