大佬求助!90怎么办啊!!!

B2088 计算书费

Lys2011 @ 2024-11-12 23:03:02

有一个过不了,求大佬指点!!!

#include<bits/stdc++.h>
using namespace std;
int main(){
    double s,sum=0,a[10]={28.9,32.7,45.6,78,35,86.2,27.8,43,56,65};
    int i;
    for(int i=0;i<10;i++){
        scanf("%lf",&s);
        a[i]*=s;
        sum+=a[i];
    }
    cout<<sum;
}

by yuhanlinluogu @ 2024-11-12 23:24:50

printf("%.1lf",sum);

printf

的格式化输出


|