Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <iostream>
  3. using namespace std;
  4. int main ()
  5. {
  6. ios::sync_with_stdio(false);
  7. cin.tie(0);
  8. freopen("even-or-odd.in", "r", stdin);
  9. freopen("even-or-odd.out", "w", stdout);
  10. long long n,k;
  11. cin>>n;
  12. for (int i=0; i<n; i++) {
  13. cin>>k;
  14. if ((int)sqrt(k)*(int)sqrt(k)==k) cout<<1;
  15. else cout<<0;
  16. }
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement