提交时间:2023-11-19 18:37:33
运行 ID: 31588
#include<iostream> #include<iomanip> using namespace std; int main() { int n[10]; double price[10]={28.9,32.7,45.6,78,35,86.2,27.8,43,56,65}; double sum=0; for(int i=0;i<10;i++) { cin>>n[i]; sum+=n[i]*price[i]; } cout<<fixed<<setprecision(1)<<sum<<endl; return 0; }