fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Scanner s=new Scanner(System.in);
  13. String sc=s.nextLine();
  14. String[] aof=sc.split("\\s");
  15. int cou = 0;
  16. for(String a:aof){
  17. cou=cou+1;
  18. System.out.println(a);
  19. }
  20. System.out.println("char"+cou);
  21.  
  22. char[] chrs=sc.toCharArray();
  23. int count=0;
  24. for(char ch:chrs){
  25. count++;
  26. System.out.println(ch);
  27. }
  28. System.out.println(count);
  29.  
  30. }
  31. }
Success #stdin #stdout 0.14s 56932KB
stdin
Kavya naramaneni cse honors
stdout
Kavya
naramaneni
cse
honors
char4
K
a
v
y
a
 
n
a
r
a
m
a
n
e
n
i
 
c
s
e
 
h
o
n
o
r
s
27