Compile Error

foo.cc: In function 'int main()':
foo.cc:22:20: error: 'n' was not declared in this scope
     for(int i=1;i<=n;i++)
                    ^
foo.cc:28:10: error: request for member 'bh' in 'a[1]', which is of non-class type 'int'
     a[1].bh=1;
          ^~
foo.cc:31:19: error: request for member 'bh' in 'a[i]', which is of non-class type 'int'
   if(i%2!=0) a[i].bh=i/2+1;
                   ^~
foo.cc:32:13: error: request for member 'bh' in 'a[i]', which is of non-class type 'int'
   else a[i].bh=n1+n2-i/2+1;
             ^~
foo.cc:35:21: error: request for member 'bh' in 'a[i]', which is of non-class type 'int'
      ans+=a[i]*a[i].bh;
                     ^~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P2425 重排数
比赛
初二数组专练10.29
语言
C++
递交时间
2021-10-29 21:21:31
评测时间
2021-10-29 21:21:31
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes