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

Re:AC了,谢以上多位,附正确的加尾数函数

Posted by Oldmaner at 2007-05-09 17:07:09 on Problem 2247
In Reply To:Re:AC了,谢以上多位,附正确的加尾数函数 Posted by:Skyscraper at 2006-07-25 18:34:34
> string GetSuffix(int num)
> {
> 	string str ="th";
> 	const static string sufs[3] ={"st", "nd", "rd"};
> 	int ba =num%10;
> 	if( ba<=3 && ba >=1 && !(num>=10 && (num/10)%10==1))
> 	{
> 	 str = sufs[ba-1];
> 	}	
> 	return str;
> }

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