84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
在做一个习题,要求如下:
我在数字比较小时已经解决了这个问题,可是当整数达到30位时,long long int 已经不能存储,请问有什么解决方法吗?
我自己写的程序详见 https://github.com/huyang7211...
欢迎大家一起来刷题
ringa_lee
Using character array processing can increase flexibility;eg:
char chArr[32] = "12345678912345678912345678912345";//你可以使用比较大的长度 int i = 0, sum = 0; for(; i < 32; i++) { sum += chArr[i] - '0'; }
用char array
You don’t actually need to store the number itself...
If it were me, I would treat this number as a string.
Using character array processing can increase flexibility;
eg:
用char array
You don’t actually need to store the number itself...
If it were me, I would treat this number as a string.