14 条题解

  • 8
    @ 2024-3-14 20:36:11
    #include<bits/stdc++.h> 
    using namespace std; 
    int main(){ 
        int a,b,i,sum=0,sum1=0; 
        double c=0,d=0;
        cin>>a>>b; 
        for(i=1;i<=a;i++){ 
            if(i%b==0){
                c=c+i;
                sum++;
            }
            else{
                d=d+i;
                sum1++;
            }
         } 
            printf("%.1f",c/sum); 
            cout<<" ";
            printf("%.1f",d/sum1); 
            return 0;
    }  
    
  • -1
    @ 2024-4-13 11:14:33

    菜就多练,输不起就别玩! 不要抄代码:)

    #include<bits/stdc++.h> using namespace std; int main(){ int n,k,sum=0,sum1=0,sum2=0,sum3=0; cin>>n>>k; for(int i=1;i<=n;i++){ if(i%k!=0){ sum=sum+i; sum1++; }if(i%k==0){ sum2=sum2+i; sum3++; } } printf("%.1lf",1.0sum2/sum3); cout<<" "; printf("%.1lf",1.0sum/sum1); return 0; }

    • -1
      @ 2024-3-24 19:23:22
      #include<bits/stdc++.h> 
      using namespace std; 
      int main(){ 
          int a,b,i,sum=0,sum1=0; 
          double c=0,d=0;
          cin>>a>>b; 
          for(i=1;i<=a;i++){ 
              if(i%b==0){
                  c=c+i;
                  sum++;
              }
              else{
                  d=d+i;
                  sum1++;
              }
           } 
              printf("%.1f",c/sum); 
              cout<<" ";
              printf("%.1f",d/sum1); 
              return 0;
      }
      

      Copy

      • -2
        @ 2024-3-22 17:43:26

        #include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; double d=0,e=0,f=0,g=0; cin>>a>>b; for(c=1;c<=a;c++){ if(c%b==0){ d+=c; g++;} else{ e+=c; f++;} } printf("%.1lf",d/g); cout<<" "; printf("%.1lf",e/f); return 0; }

        • -3
          @ 2024-4-1 22:05:03

          ciajiuduolian

          • -3
            @ 2024-3-27 17:42:37

            #include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; double d=0,e=0,f=0,g=0; cin>>a>>b; for(c=1;c<=a;c++){ if(c%b==0){ d+=c; g++;} else{ e+=c; f++;} } printf("%.1lf",d/g); cout<<" "; printf("%.1lf",e/f); return 0; }

            • -3
              @ 2024-3-22 17:54:06

              #iclude <bits/tdc++.h> using namepace std; int main() { int a,b,i,j=0,s=0; double n=0,d=0; cin>>a>>b; for(i=1;i<=a;i++){ if(i%b==0){ n=n+i; j++; } else{ d=d+i; s++; } } pritf("%.1lf",n/j); cout<<" "; pritf("%.1lf",d/s); return 0; }

              • -3
                @ 2024-3-17 9:53:08

                #include<bits/stdc++.h> using namespace std; int main(){ int n,k,i=1,sum=0,cum=0; double a=0,b=0; cin>>n>>k; while(i<=n){ if(i%k==0){ a+=i; sum++; } if(i%k!=0){ b+=i; cum++; } i++; } printf("%.1lf",a/sum); cout<<" "; printf("%.1lf",b/cum); return 0; }

                • -4
                  @ 2024-3-22 17:57:32

                  #iclude <bits/tdc++.h> using namepace std; int main() { int a,b,i,j=0,s=0; double n=0,d=0; cin>>a>>b; for(i=1;i<=a;i++){ if(i%b==0){ n=n+i; j++; } else{ d=d+i; s++; } } pritf("%.1lf",n/j); cout<<" "; pritf("%.1lf",d/s); return 0; }

                  • -4
                    @ 2024-3-22 17:56:21

                    #iclude <bits/tdc++.h> using namepace std; int main() { int a,b,i,j=0,s=0; double n=0,d=0; cin>>a>>b; for(i=1;i<=a;i++){ if(i%b==0){ n=n+i; j++; } else{ d=d+i; s++; } } pritf("%.1lf",n/j); cout<<" "; pritf("%.1lf",d/s); return 0; }

                    • -7
                      @ 2024-3-10 11:08:18

                      别想要题解

                      • -9
                        @ 2024-3-10 10:43:58

                        hdefjrsgevh

                        • -10
                          @ 2024-3-10 11:07:16

                          VN客家话

                          • -14
                            @ 2024-3-10 10:14:46

                            谁发个题解

                            • 1

                            信息

                            ID
                            646
                            时间
                            1000ms
                            内存
                            125MiB
                            难度
                            4
                            标签
                            (无)
                            递交数
                            370
                            已通过
                            180
                            上传者