Runtime Error

foo.cc: In function 'int main()':
foo.cc:24:68: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'char (*)[20]' [-Wformat=]
   scanf("%d %s %d %f",&sr[i].id,sr[i].name,&sr[i].phone,&sr[i].secs);
                                            ~~~~~~~~~~~~            ^
foo.cc:24:68: warning: format '%f' expects argument of type 'float*', but argument 5 has type 'int*' [-Wformat=]
foo.cc:24:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %s %d %f",&sr[i].id,sr[i].name,&sr[i].phone,&sr[i].secs);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:18:15: warning: 'k' may be used uninitialized in this function [-Wmaybe-uninitialized]
  int i,flag,j,k,n;
               ^
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Runtime Error Segmentation fault 1ms 384.0 KiB

信息

递交者
类型
递交
题目
P1154 结构体-手机通话记录2
语言
C++
递交时间
2021-11-14 16:06:15
评测时间
2021-11-14 16:06:15
评测机
分数
0
总耗时
1ms
峰值内存
384.0 KiB