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:哭诉:地名可能只有一个字母!!!老子在这里WA了8次·····血的教训···附测试数据

Posted by zhouyusong at 2011-10-27 19:54:32 on Problem 1326
In Reply To:Re:哭诉:地名可能只有一个字母!!!老子在这里WA了8次·····血的教训···附测试数据 Posted by:zhouyusong at 2011-10-27 19:54:01
不一定

#include <iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
   char p1[40],p2[40];
   int s;
   char c;
   int sum;
   scanf("%s",p1);
   while(strcmp(p1,"#")!=0)
   {

       sum=0;
       while(strcmp(p1,"0")!=0)
       {
          scanf("%s",p2);
          scanf("%d",&s);
          getchar();
          scanf("%c",&c);
          if(c=='F')sum+=2*s;
          else if(c=='B')sum+=(s+1)/2+s;
          else if(s<500)sum+=500;
          else sum+=s;
          scanf("%s",p1);
       }
       printf("%d\n",sum);
      scanf("%s",p1);
   }

    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