0_0_36027564_9682.cpp: In function 'int main()': 0_0_36027564_9682.cpp:19:16: error: 'i' was not declared in this scope ans+=abs(x[i]-tp); ^