|
|
back to boardWhy this is said "wrong" ? this is true. #include <iostream> #include <math.h> using namespace std; int main() { int n,k,i,a;float z; cin>>n; int *b; b=new int [n]; for(i=1;i<=n;i++){cin>>k;z=sqrt((k-1)*8+1);a=z;if(a==z)b[i-1]=1;else b[i-1]=0;} for(i=1;i<=n;i++)cout <<b[i-1]<<" "; return 0; } |
|
|