Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
77002 梁敖铭 情报加密 C++ Compile Error 0 MS 0 KB 333 2024-06-08 08:40:35

Tests(0/0):


Code:

#include <stdio.h> #include <string.h> int main() { int n=100; char s[N]; while(gets(s)) { int len=strlen(s); for(int i=0; i<len; i++) { if('a'<=s[i]&&s[i]<='y') s[i]++; else if('A'<=s[i]&&s[i]<='Y') s[i]++; else if(s[i]=='z') s[i]='a'; else if(s[i]=='Z') s[i]='A'; } puts(s); } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:8: error: 'N' was not declared in this scope
 char s[N]; 
        ^
Main.cc:7:7: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
 while(gets(s)) 
       ^
In file included from Main.cc:1:0:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cc:7:7: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
 while(gets(s)) 
       ^
In file included from Main.cc:1:0:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cc:7:12: error: 's' was not declared in this scope
 while(gets(s)) 
            ^
Main.cc:5:10: warning: unused variable 'n' [-Wunused-variable]
      int n=100;
          ^