Main.cc: In function 'int main()': Main.cc:7:9: error: 'km' was not declared in this scope km=2*6+(d-2)*1.8; ^ Main.cc:11:9: error: 'km' was not declared in this scope km=km+1.8/2*(d-10); ^