Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Problem: on_off
//'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[]) { for(int num=1 ; num<=100 ; num++) { if((num % 3)==0 && (num % 5) == 0) System.out.println("OnOff"); else if((num % 3) == 0) System.out.println("On"); else if((num % 5) == 0) System.out.println("Off"); else System.out.println(num); } } }
run
|
edit
|
history
|
help
0
Bubble Sort
Linear Seach
bubble sort
3.c
Java - Swap two numbers without using temp var
Tree ZigZag Traversal
LRU cache - Simple solution (costly)
Bubble Sort Java 2
boundary vs core
contoh 43