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 dryson at 2008-04-22 20:05:16 on Problem 1519
把每一位数都加起来(用字符串数组),它们的和不会超过9*输入的总位数。举个例子,输入一个1千位的整数,所有位的累加和不会超过9000,所以用一个整形数int n完全可以装入。然后对这个数n取模,如果模为0,答案即为9,否则答案就是它的模。

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