Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import static java.lang.Math.sqrt;
- public class Ten
- {
- public static void main(String[] args)
- {
- Scanner in = new Scanner(System.in);
- int n = in.nextInt();
- double[] a = new double[n];
- for (int i = 0; i < n; i++)
- a[i] = (int)in.nextDouble();
- for (double anA : a)
- {
- double x = (-1 - sqrt(1 - 8 * (1 - anA)));
- if (x == (int) x) System.out.print("1 ");
- else System.out.print("0 ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement