为啥?
查看原帖
为啥?
1743058
Pan_Da_YA楼主2025/8/30 13:21
#include<iostream>
using namespace std;
bool zhi(int x){
	if(x==2) return true;
	for(int i=2;i<=x;i++){
		if(x%i==0) return false;
		return true;
	}
}
int a,b;
int main(){
	cin>>a>>b;
	int he=0;
	for(int i=a;i<=b;i++){
		if(zhi(i)) he+=1;
	}
	cout<<he;
	return 0;
}
2025/8/30 13:21
加载中...