实验10 指针2

/* 密码变换问题 */
#include<stdio.h>
#include<string.h>
#define MAXLINE 80
void encrypt(char*);
int main(void)
{
    char line[MAXLINE];
    printf("输入字符串");
    gets(line);
    encrypt(line);
    printf("%s%s
","After being encrypted:",line);
    return 0;
}
void encrypt(char*s)
{
    for(;*s!='';s++)
        if(*s=='z')
            *s='a';
        else
            *s=*s+1;
}
原文地址:https://www.cnblogs.com/shenyunwen/p/3422604.html