/ Vijos /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:12:22: error: 'ans' was not declared in this scope
   if(b[j]>=a[i]) j--,ans++;
                      ^~~
foo.cc:12:22: note: suggested alternative: 'abs'
   if(b[j]>=a[i]) j--,ans++;
                      ^~~
                      abs
foo.cc:15:19: error: 'ans' was not declared in this scope
     printf("%d\n",ans);
                   ^~~
foo.cc:15:19: note: suggested alternative: 'abs'
     printf("%d\n",ans);
                   ^~~
                   abs
foo.cc:6:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&n,&m);
  ~~~~~^~~~~~~~~~~~~~
foo.cc:7:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1;i<=n;i++) scanf("%d",&a[i]);
                        ~~~~~^~~~~~~~~~~~
foo.cc:8:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1;i<=m;i++) scanf("%d",&b[i]);
                        ~~~~~^~~~~~~~~~~~

信息

递交者
类型
自测
题目
P1291 苹果摘陶陶
语言
C++
递交时间
2020-11-02 23:41:11
评测时间
2020-11-02 23:41:11
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes