Run ID:88531
提交时间:2024-08-19 11:46:24
#include<iostream> #include<cstdio> using namespace std; int main() { int banana=5; int apple=8; int grape=12; double avg; printf("平均单价为%.3lf元\n",(banana+apple+grape)/3.0); cout<<"香蕉可以买"<<39/5<<"斤,剩余"<<39%5<<"元"<<endl; cout<<"苹果可以买"<<39/8<<"斤,剩余"<<39%8<<"元"<<endl; cout<<"葡萄可以买"<<39/12<<"斤,剩余"<<39%12<<"元"<<endl; return 0; }