Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Initials
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
1a
темп
JAVA regex for only allow numbers
Трикотаж
LeetCode 121 - Best time to buy and sell stock - O(n) solution
test1
Fraction implementation using oops in java
Alumnos Java con Input
http://stackoverflow.com/questions/23175927/how-to-clone-object-defined-by-interface
Homework