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 |
Re:AC了,谢以上多位,附正确的加尾数函数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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator