运行 ID: 29295

Main.cc: In function ‘int main()’:
Main.cc:9:9: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations]
 gets(str);
         ^
In file included from /usr/include/stdio.h:862:0,
                 from Main.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:232:1: note: declared here
 gets (char *__str)
 ^~~~
Main.cc:11:5: error: ‘strlen’ was not declared in this scope
 len=strlen(str);
     ^~~~~~
Main.cc:11:5: note: suggested alternative: ‘str’
 len=strlen(str);
     ^~~~~~
     str
Main.cc:9:5: warning: ignoring return value of ‘char* gets(char*)’, declared with attribute warn_unused_result [-Wunused-result]
 gets(str);
 ~~~~^~~~~