|
|
back to boardWA#1 help me!! Posted by hhh 5 Jan 2009 23:39 #include <iostream> using namespace std; int main() { long long n,a[65550],i,k=1,b=1; cin>>n; for(i=0; i<n; i++) { cin>>a[i]; k=1; b=1; while(k<=a[i]) { b+=k; k++; } if(b==a[i]) cout<<1<<" '; else cout<<0<<" "; } return 0; } |
|
|