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 zjp at 2009-07-14 13:59:41 on Problem 3077
#include <stdio.h>

   int main()
	 {   
	     int i;
	     int N;
		 int a;
		 int x;
		 int k;
	    scanf("%d",&N);
	    while (N--)
		{  k=0;
	      scanf("%d",&a);
		   while (a>10)
		   {
		      x=a%10; 
			  a/=10;
			  k++;
			  if (x>=5)
				  a=a+1;
		   }
	     printf ("%d",a);
	      for (i=0;i<k;i++)
	       printf("0");
	       printf("\n");
	
		}
	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