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

小妹求救!!!!!为何超是???????

Posted by y05zyg at 2006-05-09 19:27:32 on Problem 1326
# include<iostream.h>
# include<math.h>
# include<string.h>
int main()
{
	char a[10][20];//保存起点
	char b[10][20];//保存终点 
	double c[10];//保存距离
	char d[10];//保存机舱号	
	int i;
	i=0;
	double  s;	
	cin>>a[i]>>b[i]>>c[i]>>d[i];
	while(a[i][0]!='#')
	{
		s=0;	
		while (a[i][0]!='0')
		{
			switch(d[i])
			{
			case 'F': s+=c[i]+c[i]; break;
			case 'B': s+=c[i]+(c[i]+1)/2; break;
			case 'Y': s+=(c[i]>500)?c[i]:500; break;
			}
			i++;		
			cin>>a[i];
			if(a[i][0]=='0') break;
			else 
			cin>>b[i]>>c[i]>>d[i];
		}		
		cout<<(int)s<<endl;
		cin>>a[i];
		if(a[i][0]=='#')break;
		else
		cin>>b[i]>>c[i]>>d[i];		
	}	
	return 0;
}



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