1 条题解

  • 0
    @ 2026-1-16 17:45:12

    #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; }

    • 1

    信息

    ID
    9138
    时间
    1000ms
    内存
    128MiB
    难度
    3
    标签
    递交数
    5
    已通过
    4
    上传者