hhx7914 @ 2022-01-31 19:47:34
#include<stdio.h>
int main() {
int n, k,sum=0;
scanf_s("%d", &n, &k);
float ad1=0, ad2=0;
for (int i = 0; i <= n; i++) {
if (i % n == 0) {
ad1 += i; sum++;
}
else { ad2 += i; }
}ad1 = ad1 / sum;
ad2 = ad2 / (n - sum);
printf("%.1lf %.1lf", ad1, ad2);
return 0;
}
by xzy090626 @ 2022-01-31 20:15:11
@hhx7914
scanf_s("%d", &n, &k);
这啥意思
by hhx7914 @ 2022-02-03 19:25:11
@xzy090626 vs上scanf()是用 scanf_s()表示
by xzy090626 @ 2022-02-04 21:49:54
可是它会CE啊