Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
一个简单的算法把每一位数都加起来(用字符串数组),它们的和不会超过9*输入的总位数。举个例子,输入一个1千位的整数,所有位的累加和不会超过9000,所以用一个整形数int n完全可以装入。然后对这个数n取模,如果模为0,答案即为9,否则答案就是它的模。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator