记录详情

Wrong Answer

foo.cc: In function 'int main()':
foo.cc:13:14: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
     gets(str1);
              ^
In file included from /usr/include/stdio.h:862:0,
                 from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:232:1: note: declared here
 gets (char *__str)
 ^~~~
foo.cc:14:14: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
     gets(str2);
              ^
In file included from /usr/include/stdio.h:862:0,
                 from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:232:1: note: declared here
 gets (char *__str)
 ^~~~
foo.cc:15:14: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
     gets(str3);
              ^
In file included from /usr/include/stdio.h:862:0,
                 from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:232:1: note: declared here
 gets (char *__str)
 ^~~~
foo.cc: In function 'void str_replace(char*, char*, char*)':
foo.cc:26:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i = 0; i < strlen(str1); i += gap){
                ~~^~~~~~~~~~~~~~
foo.cc:29:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(j = i, k = 0; k < strlen(str2); j++, k++){
                               ~~^~~~~~~~~~~~~~
foo.cc:37:52: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for(j = i + strlen(str2), k = 0; j < strlen(str1); j++, k++){ // 保存原字符串中剩余的字符
                                                  ~~^~~~~~~~~~~~~~
foo.cc:41:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for(j = i, k = 0; k < strlen(str3); j++, k++){ // 字符串替换
                                   ~~^~~~~~~~~~~~~~
foo.cc:45:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for(k = 0; k < strlen(temp); j++, k++){ // 剩余字符串回接
                            ~~^~~~~~~~~~~~~~
foo.cc: In function 'int main()':
foo.cc:13:9: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
     gets(str1);
     ~~~~^~~~~~
foo.cc:14:9: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
     gets(str2);
     ~~~~^~~~~~
foo.cc:15:9: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
     gets(str3);
     ~~~~^~~~~~
/tmp/ccmOcS6u.o: In function `main':
foo.cc:(.text.startup+0x3a): warning: the `gets' function is dangerous and should not be used.
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer 1d0 < we like program,we like 1ms 384.0 KiB
#2 Wrong Answer Read aaaaaaaa, expect aaaaaaaaaa. 2ms 384.0 KiB
#3 Wrong Answer Read abcdefabcdefabcdef, expect a123a123a123. 1ms 384.0 KiB
#4 Wrong Answer Read aaaaaaaaa, expect a. 1ms 384.0 KiB
#5 Wrong Answer 1d0 < we like program,we like, 1ms 384.0 KiB

信息

递交者
类型
递交
题目
P1052 OO11-4 string中的查找替换
语言
C++
递交时间
2021-08-13 16:35:29
评测时间
2021-08-13 16:36:06
评测机
分数
0
总耗时
9ms
峰值内存
384.0 KiB