Main.cc: In function 'int main()': Main.cc:10:1: error: a function-definition is not allowed here before '{' token { ^ Main.cc:30:1: error: expected '}' at end of input } ^ Main.cc:5:10: warning: unused variable 'n' [-Wunused-variable] int s=0,n=1; ^ Main.cc:30:1: error: expected '}' at end of input } ^