Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Magic No.
//'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 i,j,s=0,d,n=272; while (s!=1) { d=n%10; s=s+d; n=n/10; if (s==1) { System.out.println("Magic no."); break; } else if (n==0) n=s; if (s!=0) { System.out.println("Not Magic"); break; } } } }
run
|
edit
|
history
|
help
0
bubble sort
hellojava.java
LRU cache - Simple solution (costly)
swastik
메소드구현하기-해결
Fibonacci
moneda
Problem: fb_series
Graph adjacency list representation
Abhay