Write a program in C language, input an arbitrary integer, find its number of digits and the sum of each digit's cube

Write a program in C language, input an arbitrary integer, find its number of digits and the sum of each digit's cube


#Includemain() {int n, I, s = 0, sum = 0; printf ("please enter an integer):"; scanf (% d ", & n); I = n; while (I! = 0) {S + = (I% 10) * (I% 10) * (I% 10); I / = 10; sum + +;} printf (" is% d digits, sum of cubes is% D, sum, s);}



How to calculate the cubic number?
Unit: cm
3400*1600*2500
What's the cube? How?


There are two methods
1, in M (100cm = 1m)
=34*16*25=13600m^3
2, directly calculate 3400 * 1600 * 2500 = 13600000000cm ^ 3
Reconstituted into m ^ 3 (1000000 cm ^ 3 = 1m ^ 3)



Take any positive integer a that can be divided by 3, find the sum B of each digit cube of a, and then find the sum C of each digit cube of B. after repeated calculation for several times, you will get a constant number, which is?


Use 9 to test. 9 ^ 3 = 729, then the second operation is 7 ^ 3 + 2 ^ 3 + 9 ^ 3 = 1080, the third operation is 1 ^ 3 + 8 ^ 3 = 513, the fourth operation is 5 ^ 3 + 1 ^ 3 + 3 ^ 3 = 153, and the fifth operation is still equal to 153, so the constant number is 153