ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1209. 1, 10, 100, 1000...

WA#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; }