#Run time Error

4 messages · Page 1 of 1 (latest)

rapid pivot
#

import java.util.Scanner;

public class Main {
public static void prime(int[] num){
int count = 0;

    for (int i=0;i<num.length;i++) {
        if (num[i]>0){
        for (int j = 1; j <= num[i]; j++) {
            if (num[i] % j == 0) {
                count++;
            }
        }
        if (count == 3) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
        count = 0;
    }
    }
}

public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int size = sc.nextInt();
    int[] num =new int[size];

    for (int i =0;i<num.length;i++){
            num[i] = sc.nextInt();
    }
    prime(num);
}

}

help me solve the problem

https://codeforces.com/problemset/problem/230/B

copper ravineBOT
#

This post has been reserved for your question.

Hey @rapid pivot! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

copper ravineBOT