Mã chấm Tài khoản Bài tập Ngôn ngữ lập trình Trạng thái Thời gian Bộ nhớ Kích thước Thời gian nộp
269275 Võ Tiến Phát Chuỗi lớn nhất C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 184 2023-11-18 21:15:28

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:10:19: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations]
     gets("%s",s[n]);
                   ^
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:10:19: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     gets("%s",s[n]);
                   ^
Main.cc:10:19: error: too many arguments to function ‘char* gets(char*)’
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:9:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
Main.cc:10:9: warning: ignoring return value of ‘char* gets(char*)’, declared with attribute warn_unused_result [-Wunused-result]
     gets("%s",s[n]);
     ~~~~^~~~~~~~~~~