Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class HomeworkMath {
- public static int sumOfSumsOfDigitsInCyclicOrder(final int inputNumber) {
- int remainingDigits = inputNumber, summedDigits = 0, sumOfSumsResult = 0;
- while (remainingDigits > 0) {
- summedDigits += remainingDigits % 10;
- sumOfSumsResult += summedDigits;
- remainingDigits /= 10;
- }
- return sumOfSumsResult;
- }
- }
Add Comment
Please, Sign In to add comment