foo.cc:11:2: error: expected initializer before 'int'
int n, res = 0; scanf("%d", &n);
^~~
foo.cc:11:23: error: expected constructor, destructor, or type conversion before '(' token
int n, res = 0; scanf("%d", &n);
^
foo.cc:12:7: error: expected constructor, destructor, or type conversion before '(' token
scanf("%s", a);
^
foo.cc:13:2: error: expected unqualified-id before 'for'
for ( auto i : a )
^~~
foo.cc:15:8: error: expected constructor, destructor, or type conversion before '(' token
printf("%d", res);
^
foo.cc:16:1: error: expected declaration before '}' token
}
^
[Hydro](https://hydro.ac)提供评测服务