You are viewing a single comment's thread. Return to all comments →
why my second case isn't executed? for(int a0 = 0; a0 < t; a0++){ int n; cin >> n; int sum=0; int sqsum=0; int sqaure;
for(int i=1;i<=n;i++){ sum+=i; sqaure =pow(sum,2); sqsum+=pow(i,2); } int diff=sqaure-sqsum; cout<<diff<<endl; }
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #6: Sum square difference
You are viewing a single comment's thread. Return to all comments →
why my second case isn't executed? for(int a0 = 0; a0 < t; a0++){ int n; cin >> n; int sum=0; int sqsum=0; int sqaure;