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:哭诉:地名可能只有一个字母!!!老子在这里WA了8次·····血的教训···附测试数据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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator