Main.cc:4:11: error: ‘::main’ must return ‘int’ void main() ^ Main.cc: In function ‘int main()’: Main.cc:8:7: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations] gets(a); //接收字符串 ^ 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:8:5: warning: ignoring return value of ‘char* gets(char*)’, declared with attribute warn_unused_result [-Wunused-result] gets(a); //接收字符串 ~~~~^~~