Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. /**
  2. * @param args the command line arguments
  3. */
  4. public static void main(String[] args) {
  5.  
  6. char ch;
  7. String str="";
  8. Scanner sc= new Scanner(System.in);
  9. System.out.println("Enter A Line");
  10. String S=sc.nextLine();
  11. for(int i=0;i<S.length();i++){
  12. ch=S.charAt(i);
  13. while(ch!=' '){
  14. str=str+ch;
  15. }
  16. byte[] barr=str.getBytes();
  17. for(int z=0;z<barr.length;z++){
  18. System.out.println(barr[z]);
  19. }
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement