Moxder @ 2016-10-25 17:58:21
#include<stdio.h>
int main()
{
int n,i,m,num,asc;
char pass[100]="0";
scanf("%d\n",&n);
for(i=0;;i++)
{
scanf("%c",&pass[i]);
if(pass[i]=='0'){
num=i; //num为密码的位数
break;
}
}
for(m=0;m<=num-1;m++)
{
asc=pass[m]-'\0';
asc+=n;
if(asc>=123){
asc-=26;
}
pass[m]=asc;
}
for(i=0;i<=num-1;i++)
{
printf("%c",pass[i]);
}
return 0;
}