Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Word pattern
//'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[]) { Scanner sc=new Scanner(System.in); System.out.println("Enter a string "); String ss=sc.nextLine(); String wrd="";char ch;int i,j,k,l,l1,m; ss=ss+" "; ss=ss.toUpperCase(); l=ss.length(); for(k=0;k<l;k++) { ch=ss.charAt(k); if(ch!=' ') wrd=wrd+ch; else { l1=wrd.length(); for(i=1;i<=l1;i++) { for(j=i;j<=l1;j++) { System.out.print(wrd.charAt(j-1)); } for(m=1;m<=i-1;m++) System.out.print(wrd.charAt(m-1)); System.out.println(); } wrd=""; } } } }
run
|
edit
|
history
|
help
0
Main.java
Dynamic Array
Three In A Row Solver
pourWater
victory1
stringkeyvalues
Hello
Main
javaClassAr2
Java messing around