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

55555555555555 怎么没有人回啊?

Posted by acmcc at 2004-05-28 17:09:18 on Problem 1326
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:
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