私信TA

用户名:uq_56613018273

访问量:1247

签 名:

等  级
排  名 3188
经  验 1928
参赛次数 0
文章发表 15
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

#include<stdio.h>
#include<math.h>
#include<string.h>

# define N 100001

int check(char c)
{
    if(c >= 'A' && c<= 'Z' || c <= 'z' && c >= 'a') return 1;
    else return 0;
}

int main()
{
    char t[201];
    scanf("%[^\n]",t);
    // 大小写反转
    for(int i = 0; i < strlen(t); i++)
    {
        if(t[i] >= 'A' && t[i] <= 'Z') t[i] += 32;
        else if(t[i] >= 'a' && t[i] <= 'z') t[i] -= 32;
    }
    //逆序
    for(int i = 0, j = strlen(t) - 1; i < j; i++,j--)
    {
        char t1;
        t1 = t[i];
        t[i] = t[j];
        t[j] = t1;
    }
    //循环
    for(int i = 0; i < strlen(t); i++)
    {
        t[i] = t[i] + 3;
        if(!check(t[i])) t[i]-= 26;
        printf("%c",t[i]);
    }
}


 

0.0分

1 人评分

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

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区