Main.cc: In function 'int main()': Main.cc:14:5: error: expected ',' or ';' before 'for' for(int i=0;i<=s/2;i++){ ^ Main.cc:14:17: error: 'i' was not declared in this scope for(int i=0;i<=s/2;i++){ ^