import java.util.Scanner;
public class Test {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int sum = 0;
int m = in.nextInt();
int n = in.nextInt();
for (int i=m;i<=n;i++) {
sum+= isSuShu(i)?i:0;
}
System.out.println(sum);
}
private static boolean isSuShu(int a) {
for (int i=2;i<=Math.sqrt(a);i++) {
if (a%i==0) {
return false;
}
}
return a==1?false:true;
}
}
添加回答
举报
0/150
提交
取消