P5719 【深基4.例3】分类平均

Harry_yangyangyang @ 2023-01-30 10:30:10

感觉没什么问题

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    double c1=0,c2=0,c3=0,c4=0;
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        if(i%k!=0){
            c3+=i;
            c1++;
        }else{
            c4+=i;
            c2++;
        }
    }
    printf("%.1f %.1f",c4/c2/1.0,c3/c1/1.0);
    return 0;
}

by DesignDigits @ 2023-01-30 10:33:14

就是说为什么我拿去交就过了()


by Eleveslaine @ 2023-01-30 10:34:47

@Harry_yangyangyang 确实没什么问题啊,AC 了
所以您想表达什么(雾)


by xiaoqian02 @ 2023-01-30 10:39:09

有可能 lz 语言选错了(?


by Harry_yangyangyang @ 2023-01-30 10:40:48

抱歉有可能本地编译坏了?


by Harry_yangyangyang @ 2023-01-30 10:43:49

@Franz_Liszt -nan 5.5在线输出这个


by Harry_yangyangyang @ 2023-01-30 10:44:36

百思不得其解


by StarLbright40 @ 2023-01-30 10:44:57

我猜你样例少输了个 0


by Harry_yangyangyang @ 2023-01-30 10:46:42

都输了 有可能本地坏了(键盘)


by vincentok @ 2023-08-18 15:11:18

程序没问题,就是系统可能有问题


by vincentok @ 2023-08-18 15:12:07

用其他电脑提交试试


|