Guest User

Untitled

a guest
Jan 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /**
  4. Counts the number of words in a line.
  5. Input: a string containing the line
  6. Output: the number of words in the line
  7.  
  8. public class CountWords
  9.  
  10. {
  11. public static void main(String[] args)
  12.  
  13. {
  14. // your work here
  15.  
  16. Scanner in = new Scanner(System.in);
  17. while (in.hasNext())
  18. {
  19. // more work here
  20.  
  21. }
  22.  
  23. // more work here
  24.  
  25. }
  26. }
Add Comment
Please, Sign In to add comment