Main.cc: In function 'int main()': Main.cc:18:13: error: 'tot' was not declared in this scope tot += on - p; ^ Main.cc:21:20: error: 'tot' was not declared in this scope } else if (tot - p + on != m) { ^ Main.cc:26:13: error: 'tot' was not declared in this scope cout < tot << endl; ^ Main.cc:14:10: warning: unused variable 'o' [-Wunused-variable] long o, pp = a, p = a; ^