#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 101
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
char a[N]={0};
char b[26]={'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 i=0,n=0;
while((scanf("%c",&a[i]))!=EOF)
{
i++;
}
n=strlen(a);
for(i=0;i<n-1;i++)
{
printf("%c",b[(((int)(a[i]-'a')%26)+3)]);
}
return 0;
}
应该是对的
http://www.metools.info/code/c70.html 这里有个网站
你可以把你的程序的输出和他对照
我测试了一些,没有发现不同