记录详情

Accepted

foo.c: In function 'main':
foo.c:13:9: warning: 'fgets' writing 10001 bytes into a region of size 10000 overflows the destination [-Wstringop-overflow=]
   13 |         fgets(s1,10001,stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~
foo.c:11:14: note: destination object 's1' of size 10000
   11 |         char s1[10000];
      |              ^~
In file included from foo.c:1:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/stdio.h:592:14: note: in a call to function 'fgets' declared with attribute 'access (write_only, 1, 2)'
  592 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
foo.c:14:9: warning: 'fgets' writing 10001 bytes into a region of size 10000 overflows the destination [-Wstringop-overflow=]
   14 |         fgets(s2,10001,stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~
foo.c:12:14: note: destination object 's2' of size 10000
   12 |         char s2[10000];
      |              ^~
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/stdio.h:592:14: note: in a call to function 'fgets' declared with attribute 'access (write_only, 1, 2)'
  592 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 2ms 284.0 KiB
#2 Accepted 2ms 284.0 KiB
#3 Accepted 1ms 284.0 KiB
#4 Accepted 2ms 284.0 KiB
#5 Accepted 1ms 284.0 KiB

信息

递交者
类型
递交
题目
A8-1 字符串的输出函数
比赛
2023 程序设计与竞赛(作业6:走向综合)
语言
C
递交时间
2023-10-28 10:34:24
评测时间
2023-10-28 10:34:24
评测机
分数
100
总耗时
9ms
峰值内存
284.0 KiB