| ||||||||||
| 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 | |||||||||
帮帮忙,哪错了?#include<iostream>
using namespace std;
int main()
{
int m,t,u,f,d,res=0;
char p;
cin>>m>>t>>u>>f>>d;
while(t--)
{
cin>>p;
if(m<=0)
continue;
if(p=='u' || p==d)
m=m-u-d;
else m=m-f-f;
if(m>=0)
res++;
}
cout<<res<<endl;
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator