/ 科创班 /

记录详情

Accepted

/in/foo.c: In function 'main':
/in/foo.c:7:5: warning: 'gets' is deprecated [-Wdeprecated-declarations]
     gets(ch);
     ^~~~
In file included from /in/foo.c:1:0:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/tmp/ccByYKvt.o: In function `main':
foo.c:(.text.startup+0xc): warning: the `gets' function is dangerous and should not be used.
# 状态 耗时 内存占用
#1 Accepted 1ms 256.0 KiB

代码

#include <stdio.h>

int main()
{
    int j;
    char ch[80];
    gets(ch);
    j = 0;
    while(ch[j] != '\0')
    {
        if(((ch[j] >= 'A') && (ch[j] <= 'Z')) || ((ch[j] >= 'a') && (ch[j] <= 'z')))
        {
            if(((ch[j] >= 'W') && (ch[j] <= 'Z')) || ((ch[j] >= 'w') && (ch[j] <= 'z')))
            {
                ch[j] = ch[j] - 22;
            }
            else
                ch[j] = ch[j] + 4;
        }
        else if((ch[j] >= '0') && (ch[j] <= '9'))
        {
            ch[j] = '9' - ch[j] + '0';
        }
        else
        {
            ch[j] = ch[j];
        }
        j++;
    }
    puts(ch);
    return 0;
}

信息

递交者
类型
递交
题目
加密字符串
题目数据
下载
语言
C
递交时间
2018-07-15 23:14:47
评测时间
2018-07-15 23:14:47
评测机
分数
10
总耗时
1ms
峰值内存
256.0 KiB