#include<bits/stdc++.h> using namespace std; int a,b; bool isPrime(int x){ for(int i=2; i*i<=x; i++){ if(x % i == 0) return false; } return true; } int main(){ cin>>a>>b; int ans=0; for(int j=a; j<=b; j++){ if(isPrime(j)) ans++; } cout<<ans; return 0; }
使用您的 清北信奥登峰计划 通用账户