2 Respuestas
+ 2
Do not put code in the tag section – instead link it in the description. Describe what the code is supposed to do
24th Feb 2022, 7:56 AM
Lisa
Lisa - avatar
0
import java.util.*; class a { public static void main () { Scanner sc=new Scanner (System.in); System.out.println("enter any String "); String s=sc.nextLine(); char ch; int i; s=s+" "; String w=" "; for (i=0 ;i<s.length(); i++) { ch=s.charAt(i); if (ch!=' ') { w= w+ch; } else { System.out.println(w); w=" "; } } } } // this code is not working please help
24th Feb 2022, 7:55 AM
Tanay Rastogi
Tanay Rastogi - avatar