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 20110706 at 2011-07-25 18:02:40 on Problem 3077
#include<stdio.h>
#include<math.h>
int f(double k)
{
	if(k-floor(k)<ceil(k)-k)
		return floor(k);
	else
		return ceil(k);
}
int getrounders(int m)
{
	if(m/10==0)
		return m;
	else
		return 10*(getrounders(f(m/10.0)));
}
int main()
{
	int n,s;
	scanf("%d",&n);
	while(n--)
	{
		scanf("%d",&s);
		printf("%d\n",getrounders(s));
	}
	return 0;
}


请高人指点指点

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