Run ID:3876
提交时间:2024-07-16 14:14:26
# include<iostream> # include<iomanip> using namespace std; int main(){ int a,b,c,d; a=5; b=8; c=12; d=39; //cin>>a>>b>>c>>d;//不需要录入水果的单价 cout<<fixed<<setprecision(3)<<(a+b+c)/3.0<<endl; //苹果多少斤,余下多少钱 cout<<fixed<<setprecision(5)<<d/a<<endl; cout<<fixed<<setprecision(5)<<d%a<<endl; //香蕉多少斤,余下多少钱 cout<<fixed<<setprecision(5)<<d/b<<endl; cout<<fixed<<setprecision(5)<<d%b<<endl; //葡萄多少斤,余下多少钱 cout<<fixed<<setprecision(5)<<d%c<<endl; cout<<fixed<<setprecision(5)<<d/c<<endl; return 0; }