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