Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
请帮我看看,我哪里理解错了,谢谢!In Reply To:请帮我看看这道题! 我觉得这道题是不是只能做有两种products的情况呀? Posted by:cathy1982 at 2005-03-21 19:38:26 也可能是我没理解题目,请大家指正! 是不是只求总的项数为5的时候的最低价格呀??不过,我这样做了之后,还是WA呀. 有哪位能告诉我,到底我哪里理解错了呢? #include<iostream.h> void main() { int kind,id1,total1,price1,id2,total2,price2; int special_kind,n1,dis1,dis_price1,n2,dis21,dis22,dis_price2,num; cin>>kind; cin>>id1>>total1>>price1; cin>>id2>>total2>>price2; cin>>special_kind; cin>>n1>>id1>>dis1>>dis_price1; cin>>n2>>id1>>dis21>>id2>>dis22>>dis_price2; if(total1+total2==5) { num=total2/dis22; int total_price=dis_price2*num+price2*(total2-dis22*num)+dis_price1*((total1-num)/dis1)+price1*(total1-num-dis1*((total1-num)/dis1)); cout<<total_price<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator