Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
l
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { Scanner sc=new Scanner(System.in); String nm=sc.nextLine(); nm=nm.trim(); int ln=nm.length(); int l,m,n; for(int i=ln-1;i>=0;i--) // last space { if(nm.charAt(i)==' ') { l=i; break; } } for(int j=0;j<l;j++) // first space { if(nm.charAt(j)==' ') { m=j; break; } } System.out.print(nm.charAt(0)+'.'); System.out.print(nm.charAt(m+1)+'.'); for(int q=l+1;q<ln;q++) System.out.print(nm.charAt(q)); } }
run
|
edit
|
history
|
help
0
3.A
name
hellojava.java
Simple imitation for show banners on priorities
Java Functional Programming
Interference
1*2-3+4
stringkeyvalues
doubt
calc