Compile Error

foo.cc: In function ‘int main()’:
foo.cc:17:38: error: ‘s’ was not declared in this scope
   17 |                         if(a[j]=='1')s++;
      |                                      ^
foo.cc:18:20: error: ‘s’ was not declared in this scope
   18 |                 if(s<=2)ans++;
      |                    ^
foo.cc:18:25: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
   18 |                 if(s<=2)ans++;
      |                         ^~~
      |                         abs
foo.cc:20:17: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
   20 |         if(l==1)ans--;
      |                 ^~~
      |                 abs
foo.cc:21:15: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
   21 |         cout<<ans;
      |               ^~~
      |               abs

信息

递交者
类型
递交
题目
P2948 幂和数
语言
C++
递交时间
2025-08-13 17:54:10
评测时间
2025-08-13 17:54:10
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes