|
|
back to boardWA 3 ---->C++ pls help Posted by DeDaRm 5 Dec 2013 19:32 #include <iostream> #include <cmath> using namespace std; int main () { int x,e; double nk; cin >> x; int *b=new int[x]; for (e=0; e<x; ++e) { cin >> b[e]; } for (e=0 ; e<x; ++e ) { nk = (pow((8*b[e]-7),0.5)-1)/2; long int k = static_cast< int >( nk ); if ( nk==k ) { cout << "1 "; } else { cout << "0 "; } } system ("pause > void"); } Edited by author 05.12.2013 19:32 |
|
|