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 digiter at 2009-01-23 21:17:52 on Problem 1504
int reversal(int x)
{
	char str[12];
	sprintf(str, "%d", x);
	int i = 0, j = strlen(str) - 1;
	while (i < j)
		swap(str[i++], str[j--]);
	sscanf(str, "%d", &x);
	return x;
}

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