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

分享我的输出格式控制方法

Posted by 771385494 at 2011-12-02 19:13:29 on Problem 2247
printf("The %d",n);
		if(n % 10 == 1){
			if(n % 100 == 11)
				printf("th");
			else
				printf("st");
		}
		else if(n % 10 == 2){
			if(n % 100 == 12)
				printf("th");
			else
				printf("nd");
		}
		else if(n % 10 == 3){
			if(n % 100 == 13)
				printf("th");
			else
				printf("rd");
		}
		else
			printf("th");
		printf(" humble number is %d.\n",Humble[n]);

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