Search found 2 matches

by arafat13
Tue Jul 23, 2013 9:05 am
Forum: Volume 4 (400-499)
Topic: 494 - Kindergarten Counting Game
Replies: 119
Views: 37323

Re: Runtime error help me on 494

thanks a lot. Ac by using only

while(sc.hasNext())
{
str = sc.nextLine();
System.out.println(countWords(str));
}
by arafat13
Mon Jul 22, 2013 9:42 pm
Forum: Volume 4 (400-499)
Topic: 494 - Kindergarten Counting Game
Replies: 119
Views: 37323

Runtime error help me on 494

My code:
import java.util.*;
import java.lang.*;



public class Main {


public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

String str;

while(true)
{
str = sc.nextLine();
System.out.println(countWords(str));
}

}

public static int countWords(String s ...

Go to advanced search