Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

请帮我看看这道题! 我觉得这道题是不是只能做有两种products的情况呀?

Posted by cathy1982 at 2005-03-21 19:38:26 on Problem 1170
    也可能是我没理解题目,请大家指正!
    因为题目虽然说1<=b<=5,但是,我们根本不知道其他的情况,所以就只能是两种咯!而且,打折的信息也是那两种啊!
    请帮我看看这道题!我提交后,系统提示是"runtime error",不知道为什么

#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;
         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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator