0_0_25486201_19519.cpp: In function 'int main()': 0_0_25486201_19519.cpp:22:23: error: 'q' was not declared in this scope ans+=(q+1)*q/2; ^