求助,我卡壳了
笑死,可能是晚上太累了吧{:10_250:}#include <bits/stdc++.h>
using namespace std;
const int N = 37;
int n, m;
double money, temp;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= m; j++){
cin >> temp;
money += temp;
}
}
for(int i = 1; i <= m; i++) cout << fixed << setprecision(1) << money << endl;
return 0;
} 本帖最后由 傻眼貓咪 于 2022-12-4 09:28 编辑
main.c#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
float student = { 0 }, donate;
int n, m;
if (scanf("%d%d", &n, &m)) {
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
if (scanf("%f", &donate)) {
student += donate;
}
}
}
for (int i = 0; i < m; ++i) {
printf("%.1f\n", student);
}
}
return 0;
}main.pyn, m = map(int, input().split())
student =
for i in range(n):
arr = list(map(float, input().split()))
student = + arr for j in range(m)]
for donate in student:
print(f"{donate:.1f}")
页:
[1]