记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:13:2: error: 'sort' was not declared in this scope
  sort(a,a+n);
  ^~~~
foo.cc:13:2: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from foo.cc:2:
/usr/include/c++/7/bits/stl_algo.h:4856:5: note:   'std::sort'
     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
     ^~~~
foo.cc:6:30: warning: unused variable 'flag' [-Wunused-variable]
  int i,n,w,a[300005],j,num=0,flag=0;
                              ^~~~
foo.cc:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&w);
  ~~~~~^~~~~~~~~
foo.cc:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
foo.cc:11:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&a[i]);//a[i]里是价格
   ~~~~~^~~~~~~~~~~~

信息

递交者
类型
递交
题目
P1163 纪念品分组
语言
C++
递交时间
2021-01-25 15:00:40
评测时间
2021-01-25 15:00:40
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes