Main.cc: In function 'int main()': Main.cc:9:16: error: redeclaration of 'int s' int g,s,b,q,s=0,n,i,t; ^ Main.cc:9:10: note: 'int s' previously declared here int g,s,b,q,s=0,n,i,t; ^