thanks a lot. Ac by using only
while(sc.hasNext())
{
str = sc.nextLine();
System.out.println(countWords(str));
}
Search found 2 matches
- Tue Jul 23, 2013 9:05 am
- Forum: Volume 4 (400-499)
- Topic: 494 - Kindergarten Counting Game
- Replies: 119
- Views: 37323
- 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 ...
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 ...