|
|
back to boardТут где ошибка помогите Posted by Hamdam 5 Jun 2012 21:27 #include <iostream> using namespace std; int main () { unsigned int A[65536]; unsigned short int N,Y; cin>>N; for (int i=1; i<=N;i++) cin>>A[i]; for (int i=1;i<=N; i++) { int S=0,j=1; bool k=true; while (k) { S+=j; j++; if (A[i]<=S) k=false; } Y=S-A[i]; if (((j-1)-Y)==1) cout<<"1"<<" "; else cout<<"0"<<" "; } return 0; } Edited by author 06.06.2012 18:42 Re: Тут где ошибка помогите hi mister Hamdam your code has any mistake it's truely code is mine so you want to see it? please phone to me if you have any questions phone number: +998916378115 Ok!!! Re: Тут где ошибка помогите Let's take it!!! #include <iostream> #include <math.h> using namespace std; int main() { long float m,n; int N; cin>>N; for (int i=1; i<=N; i++) { cin>>m; n=(1+sqrt(8*m-7))/2; if((1+sqrt(8*m-7))/2==floor((1+sqrt(8*m-7))/2)) cout<<1<<" "; else cout<<0<<" "; } cin>>N; return 0; } Re: Тут где ошибка помогите Posted by Hamdam 6 Jun 2012 23:16 Kottakon raxmat ! Edited by author 06.06.2012 23:17 |
|
|