import java.util.*;
public class Prime {public static void main(String[] args) {
for (int i = 2; i <= 100; i++)
{
CheckPrimeNumber(i);
}
}
public static void CheckPrimeNumber(int num)
{
int sum = 0;
for (int i = 1; i <= num; i++)
{
if (num % i == 0) {
sum++;
}
}
if (sum == 2)
{
System.out.print(num+",");
}
}
}
没看明白啊,谁能帮我解释一下这段代码 |