Open hwangnk1004 opened 4 years ago
문제 http://59.23.150.58/30stair/penta/penta.php?pname=penta
답
import java.util.Scanner;
public class Main { public static void main(String args[]) {
Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int arr[] = new int[n]; for (int i = 0; i < n; i++) { arr[i] = scanner.nextInt(); int sum = 0; for (int j = 1; j <= 81; j++) { if (arr[i] == (3 * j * j - j) / 2) { sum++; } } if (sum >0) { System.out.println(arr[i]+" Y"); } else { System.out.println(arr[i]+" N"); } } }
}
문제 http://59.23.150.58/30stair/penta/penta.php?pname=penta
답
import java.util.Scanner;
public class Main { public static void main(String args[]) {
}