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

Re:我的改成那样了,为什么还错啊?请大牛帮帮忙啊!!!

Posted by lilove at 2008-12-28 14:27:40 on Problem 1326
In Reply To:Re:我的改成那样了,为什么还错啊?请大牛帮帮忙啊!!! Posted by:13227183 at 2008-07-25 11:00:40
> /* Note:Your choice is C IDE */
> #include "stdio.h"
> #include "string.h"
> void main()
> {
>     int m=0,dis,k=0;
>     char or[100],di[100],code,ch;
> 
>     scanf("%s%s",or,di);
>     while(strcmp(or,"0")!=0&&di[0]!='#')
>     {
>     scanf("%d%c%c",&dis,&ch,&code);
>     switch(code)
>     {
>       case 'F':m=m+dis*2;break;
>       case 'B':m=m+dis+(dis+1)/2;break;
>       case 'Y':
>                if(dis<500)m=m+500;
>                else
>                m=m+dis;break;
>     } 
>     scanf("%s%s",or,di);
>     }
>     
>     printf("%d\n",m);
> }

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