| ||||||||||
| 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:一次ACIn Reply To:一次AC Posted by:785815369 at 2010-07-28 09:32:04 附上代码 简单处理输入 希望给有需要的点帮助
int main()
{
string str;
int num;
char ch;
cin>>str;
while(1)
{
int sum=0;
if(str=="#")break;
if(str!="0")
while(1)
{
if(str=="0")break;
cin>>str>>num>>ch;
if(ch=='F')sum+=num*2;
else if(ch=='B')sum+=num+(int)(1.0*num/2+0.5);//四舍五入
else if(ch=='Y')
{
if(num<500)sum+=500;
else sum+=num;
}
cin>>str;
}
cout<<sum<<endl;
cin>>str;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator