Main.cc: In function ‘int main()’: Main.cc:5:22: error: redeclaration of ‘int m’ int n,m,n1,m1,n2,m; ^ Main.cc:5:11: note: ‘int m’ previously declared here int n,m,n1,m1,n2,m; ^ Main.cc:8:19: error: ‘m2’ was not declared in this scope cin>>n1>>m1>>n2>>m2; ^~ Main.cc:8:19: note: suggested alternative: ‘n2’ cin>>n1>>m1>>n2>>m2; ^~ n2