Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P7 {
- public static void main(String[] args) {
- Scanner scanner=new Scanner(System.in);
- int range=scanner.nextInt();
- for(int i=1;i<=range;i++){
- String stringInput =scanner.nextLine();
- String[] total =stringInput.split("\\s");
- int length=total.length;
- System.out.println(length);
- }
- }
- }
Add Comment
Please, Sign In to add comment