bappi2097

Timus 1209

Apr 2nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;
  6. cin>>n;
  7. while(n--)
  8. {
  9. int a,count=0;
  10. bool b=0;
  11. cin>>a;
  12. for(int i=0;!b;i++)
  13. {
  14. count++;
  15. if(a==count)
  16. {
  17. cout<<1<<'\n';
  18. b=1;
  19. }
  20. for(int j=0;j<i;j++)
  21. {
  22. count++;
  23. if(count==a)
  24. {
  25. cout<<0<<'\n';
  26. b=1;
  27. }
  28. }
  29. }
  30. }
  31. return 0;
  32. }
Add Comment
Please, Sign In to add comment