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

my code:

Posted by cugwei at 2004-05-28 00:56:10 on Problem 1326
In Reply To:我也一样啊!郁闷ing!!----在zju可以AC的程序在这里狂wa Posted by:cugwei at 2004-05-28 00:53:17
#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