foo.cc: In function 'int main()':
foo.cc:40:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |    printf("%d",ans);
      |                ^~~
      |                abs
foo.cc:32:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   32 |  scanf("%d",&n);
      |  ~~~~~^~~~~~~~~
foo.cc:34:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   34 |   scanf("%d",&a[i]);
      |   ~~~~~^~~~~~~~~~~~
   
  
    [Hydro](https://hydro.ac)提供评测服务