C猿


私信TA

用户名:219123

访问量:1013

签 名:

我写的代码如果运行报错,可能是使用了scanf_s或者gets_s把s删了就好

等  级
排  名 5570
经  验 1468
参赛次数 0
文章发表 32
年  龄 21
在职情况 学生
学  校 哔哩哔哩大学
专  业 自动化

  自我简介:

解题思路:

注意事项:

参考代码:

#include<stdio.h>

#include<string.h>

#define Long 80//允许输入字符串长度


int main()

{

            void telegraph_decrypt(char* telegraph, int n);

            char telegraph[Long];

            gets_s(telegraph, Long);

            telegraph_decrypt(telegraph, strlen(telegraph));

            printf("%s", telegraph);

            return 0;

}


void telegraph_decrypt(char * telegraph,int n)

{

        int i;

        for (i=0; i < n; i++)

        {

            if (*(telegraph + i) >= 'a' && *(telegraph + i) <= 'y')*(telegraph + i)=*(telegraph + i) + 1;

            else if (*(telegraph + i) == 'z')*(telegraph + i) = *(telegraph + i) - 25;

        }

}








 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区