Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.StringTokenizer;
- public class Main {
- public static void main(String[] args) {
- String s = "sor amit tordelni kell";
- StringTokenizer st = new StringTokenizer(s);
- st = new StringTokenizer(s," ");
- int hossz = 0;
- while(st.hasMoreTokens()){
- String resz = st.nextToken();
- hossz++;
- }
- System.out.println("Szavak szama: "+hossz);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement