foo.cpp:1:1: error: 'include' does not name a type
include <iostream> include <stdio.h>
^
foo.cpp: In function 'int read()':
foo.cpp:7:39: error: 'getchar' was not declared in this scope
int x = 0 , f = 1; char ch = getchar();
^
foo.cpp:9:41: error: expected ';' before numeric constant
while( ch >= '0' && ch <= '9' ){ x = x 10 + ch - '0'; ch = getchar(); }
^
foo.cpp:10:11: error: expected ';' before 'f'
return x f;
^
foo.cpp:10:12: warning: statement has no effect [-Wunused-value]
return x f;
^
foo.cpp: In function 'int main()':
foo.cpp:31:18: error: 'scanf' was not declared in this scope
scanf( "%s" , s ) , b[i] = read();
^
foo.cpp:42:2: error: 'cout' was not declared in this scope
cout << ans << endl;
^
foo.cpp:42:17: error: 'endl' was not declared in this scope
cout << ans << endl;
^