| ||||||||||
| 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 | |||||||||
我遇到了一样的问题啊,今天刚在zoj上交了,ac了啊,可是在poj上一交就是wa!!!!!!!!In Reply To:my code: Posted by:cugwei at 2004-05-28 00:56:10 > #include<stdio.h>
> #include<string.h>
> #include<math.h>
> void main()
> {
> char in[40],mode;
> int len,k,i;
> float n,m;
> gets(in);
> while(in[0]!='#')
> {
> n=0;
> while(in[0]!='0')
> {
> m=0;
> len=strlen(in);
> mode=in[len-1];
> for(i=len-3,k=-1;in[i]!=' ';i--)
> {
> k++;
> m+=(in[i]-'0')*(float)pow(10,k);
> }
> switch(mode)
> {
> case 'F': m*=2;
> break;
> case 'B': m*=1.5;
> break;
> case 'Y': if(m<=500) m=500;
> break;
> }
> n+=m;
> gets(in);
> }
> printf("%.0f\n",n);
> gets(in);
> }
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator