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 13227183 at 2008-07-25 11:00:40 on Problem 1326
In Reply To:Re:提交了20多次再加上和同学AC的代码比较终于知道陷阱在哪儿了.估计WA的都是这样. Posted by:liymouse at 2005-09-06 19:09:05
> 果真是这样!
/* 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