Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Problem: Single_digit
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int sum = 11; int input = 9223; while ( sum > 10){ sum = 0; while (input != 0){ sum = sum+ (input%10); input = input/10; } if (sum >= 10) input = sum; } System.out.println(sum); } }
run
|
edit
|
history
|
help
0
final method
ABC`s
jb14.0 lyambds
Opr
switching light bulbs
Interference
Java 8... lambda, streams und so...
OurDate.java
else weird
jb11.0 threads