Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62220 邓昊源 删除数字字符 C++ Compile Error 0 MS 0 KB 231 2023-12-19 20:23:24

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ char a[1000010]={0}; gets(a); for(i=0;a[i]!='\0';i++) if(a[i]<'0'||a[i]>'9'){ cout<<a[i]; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:5: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
     gets(a);
     ^
In file included from /usr/include/c++/5/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:46,
                 from Main.cc:1:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cc:8:5: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
     gets(a);
     ^
In file included from /usr/include/c++/5/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:46,
                 from Main.cc:1:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cc:8:11: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
     gets(a);
           ^
In file included from /usr/include/c++/5/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:46,
                 from Main.cc:1:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cc:9:9: error: 'i' was not declared in this scope
     for(i=0;a[i]!='\0';i++)
         ^
Main.cc: At global scope:
Main.cc:15:5: error: expected unqualified-id before 'return'
     return 0;
     ^
Main.cc:16:1: error: expected declaration before '}' token
 } 
 ^
Main.cc: In function 'int main()':
Main.cc:8:12: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
     gets(a);
            ^