/ OPS /

记录详情

Accepted

/in/foo.cc: In function 'int main()':
/in/foo.cc:17:26: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
   17 |     while(flag!=0&&gets(r)){
      |                          ^
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /usr/include/c++/9/ext/string_conversions.h:43,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from /in/foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
  235 | gets (char *__str)
      | ^~~~
/in/foo.cc:17:26: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
   17 |     while(flag!=0&&gets(r)){
      |                          ^
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /usr/include/c++/9/ext/string_conversions.h:43,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from /in/foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
  235 | gets (char *__str)
      | ^~~~
/in/foo.cc:18:15: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     for(j=0; j<strlen(r); j++)
      |              ~^~~~~~~~~~
/in/foo.cc:8:26: warning: unused variable 'c' [-Wunused-variable]
    8 |     char r[1000],s[1000],c;
      |                          ^
/in/foo.cc:10:9: warning: unused variable 'n' [-Wunused-variable]
   10 |     int n,i,j,t=0;
      |         ^
/in/foo.cc:10:15: warning: unused variable 't' [-Wunused-variable]
   10 |     int n,i,j,t=0;
      |               ^
/usr/bin/ld: /tmp/ccXAbWqO.o: in function `main':
foo.cc:(.text.startup+0x71): warning: the `gets' function is dangerous and should not be used.
# 状态 耗时 内存占用
#1 Accepted 3ms 336.0 KiB

信息

递交者
类型
递交
比赛
2024_2025(1)C0023实验6+李强老师班级
语言
C++
递交时间
2024-12-05 09:28:20
评测时间
2024-12-05 09:28:20
评测机
分数
10
总耗时
3ms
峰值内存
336.0 KiB