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

不知道为什么就WA了,各位高手帮忙看一下!非常感谢了!

Posted by JosephJoe at 2007-12-17 18:50:38 on Problem 1326
#include "iostream"
using namespace std;
#define N 20
int main()
{char OriCity[N],DistCity[N],ClassCode,c;
	int Actual_miles,sum;
	while(c!='#') 
   { 
   	sum=0;
   	while(cin.peek()!='0')
     {  scanf("%s %s %d %c",OriCity,DistCity,&Actual_miles,&ClassCode);
     	getchar();
		if(ClassCode=='F')sum+=Actual_miles*2;
         else if(ClassCode=='B')sum+=Actual_miles+(Actual_miles+1)/2;
         else if(ClassCode=='Y')
             {
             	if(Actual_miles<=500)sum+=500;
             	else sum+=Actual_miles;
             }
      }
    getchar();
	 cout<<sum<<endl;
	 	 cin>>c;
   }
   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