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 |
Re:真是郁闷死人了,有路过的帮我看看 啊 老waIn Reply To:真是郁闷死人了 Posted by:ljl08 at 2007-08-02 07:14:26 #include <iostream> using namespace std; void main(){ char city[100]; char code; int m; int dis; while(1){ m=0; while(1){ cin>>city; if(strcmp(city,"0")==0||strcmp(city,"#")==0)break; cin>>city; cin>>dis; cin>>code; switch(code){ case 'F': m+=dis*2; break; case 'B': m+=dis+(dis+1)/2; break; case 'Y': dis=dis>500?dis:500; m+=dis; break; } } cout<<m<<endl; if(strcmp(city,"#")==0) break; else continue; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator