about summary refs log tree commit diff
path: root/usth/ICT2.2/labwork/4/WordCount.java
blob: 4d0bfc6559c446ef8d041ba3eb4b23abb625c96d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import java.util.Scanner;

class WordCount
{
  public static void main(String... args)
  {
    var scanner = new Scanner(System.in);
    int count = 0;
    while (scanner.hasNext())
      {
        scanner.next();
        count++;
      }
    System.out.println(count);
  }
}