MCPcopy Create free account
hub / github.com/Hazrat-Ali9/Computer-Programming / main

Method main

Problem6.java:7–34  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

5public class Problem6 {
6
7 public static void main(String[] args) {
8 // TODO Auto-generated method stub
9 Scanner scan = new Scanner(System.in);
10 int N, number, root;
11 String[] answers;
12
13 N = scan.nextInt();
14 scan.nextLine();
15 answers = new String[N];
16
17 for (int i = 0; i < N; i++) {
18 number = scan.nextInt();
19
20 root = (int) Math.sqrt(number);
21
22 if (Math.pow(root, 2) == number) {
23 answers[i] = "YES";
24 } else {
25 answers[i] = "NO";
26 }
27 }
28 scan.close();
29
30 for (String string : answers) {
31 System.out.printf("%s\n", string);
32 }
33
34 }
35
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected