|
|
вернуться в форумWhere i am wrong? Where i am wrong? #include <iostream> #include <cmath> using namespace std; int main () { double n,i,a,f,m; cin>>n; for (i=1;i<=n;i++) { cin>>a; m=sqrt (8*a-7); f=int (m); if (m==f) cout<<"1"; else cout<<"0"; } } Re: Where i am wrong? f = int(m); f = ceil(m); m=sqrt (8*a-7); m = [sqrt(8.0*a-7.0)-1.0]/2.0 Edited by author 23.10.2010 11:26 |
|
|