Created
May 15, 2015 11:53
-
-
Save ankur-anand/7f1f237fafe0d01e7c2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Scanner; | |
class TestClass { | |
public static void main(String args[] ) throws Exception { | |
Scanner keyboard=new Scanner(System.in); | |
int t=keyboard.nextInt(); | |
keyboard.nextLine(); | |
ArrayList<String> vowelList= new ArrayList<>(); | |
vowelList.add("a"); | |
vowelList.add("e"); | |
vowelList.add("i"); | |
vowelList.add("o"); | |
vowelList.add("u"); | |
while(t!=0){ | |
String s= keyboard.nextLine(); | |
int len=s.length(); | |
String sub=s.substring(4,len-4); | |
String[] splitted=sub.split("\\B"); | |
ArrayList<String> splt= new ArrayList<>(); | |
for(String x:splitted){ | |
splt.add(x); | |
} | |
splt.removeAll(vowelList); | |
int size=splt.size(); | |
System.out.println(size+4+"/"+len); | |
t--; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment