3 条题解

  • 1
    @ 2026-5-8 17:19:32

    #include<bits/stdc++.h> using namespace std; bool ss(int x){ for(int i=2;i<x;i++){ if(x%i==0){ return false; } } return true; } int main(){ int s,d=0; cin>>s; for(int j=2;j<=s;j++){ if(ss(j)==true){ d++; } } cout<<d; return 0; }


    • 1
      @ 2025-7-23 11:05:45
      #include<bits/stdc++.h>
      using namespace std;
      bool ss(int x){
          for(int i=2;i<x;i++){
              if(x%i==0){
                  return false;
              }
          }
          return true;
      }
      int main(){
          int s,d=0;
          cin>>s;
          for(int j=2;j<=s;j++){
              if(ss(j)==true){
                  d++;
              }
          }
          cout<<d;
          return 0;
      }
      
      • 1
        @ 2025-5-28 17:09:34

        #include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; int b=0,c=0; for(int i=2;i<=a;i++){ for(int y=1;y<=a;y++){ if(i%y0){ b++; } } if(b2){ c++; } b=0; }
        cout<<c; return 0; }

        • 1

        信息

        ID
        155
        时间
        1000ms
        内存
        256MiB
        难度
        5
        标签
        递交数
        181
        已通过
        68
        上传者