0_0_37592934_1099.cpp: In function 'int main()': 0_0_37592934_1099.cpp:40:13: error: 'ave' was not declared in this scope ave=(double)pk[i].v/pk[i].w; ^