View Code of Problem 58

import java.util.Scanner;
 
 
public class Main 
{
    public static void main(String[] args) 
    {
        Scanner scan = new Scanner(System.in);
       String str=scan.nextLine();
      String[] a=str.split("\\s");
      System.out.print(a.length);
    }
}

Double click to view unformatted code.


Back to problem 58