Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
AllStar
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.Scanner; class Rextester { private static String allStar (String str) { return str.length () > 1 ? str.substring (0, 1).concat ("*").concat ( allStar (str.substring (1)) ) : str; } public static void main(String args[]) { Scanner scan = new Scanner (System.in); String [] arr = new String [5]; int i = 0; try { while ( (arr[i] = scan.nextLine ()) != "" ) System.out.println (allStar (arr [i++])); } catch (Exception e) { System.out.println ("\nno more found!"); } } }
run
|
edit
|
history
|
help
0
Print String in Reverse
Leetcode 937. Reorder Log Files๐ฎ๐ณ๐ฎ๐ณ๐ฎ๐ณ
Odd Occurence Problem Template
detect cycle in singly linked list
pow binary
4.b
Remove unbalanced parentheses in a given expression
pre
H
Max palindrome string