|
|
back to boardTest 1 help please. Hi! Please help russian shoolboy Where the error is? I realized that '1'-s are in the field of the sequence. 1 2 4 7 11 16 int main() { long a,j,i,n; cin>>n; for(int x=0; x<n; x++) { cin>>a; i=1; j=1; while (a>i) { i=i+j; j++; } if (a==i) cout<<1; else cout<<0; } return 0; } Re: Test 1 help please. Posted by Dima 5 Mar 2013 01:54 while (a>i) { i=i+j; j++; } |
|
|