Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package problem3;
- import java.io.BufferedReader;
- import java.io.FileNotFoundException;
- import java.io.FileReader;
- import java.io.IOException;
- public class File {
- public static void main(String[] args) {
- String[] words = null;
- String s;
- int flag;
- char ch,ch1;
- BufferedReader br = null;
- try {
- br = new BufferedReader(new FileReader("input.txt"));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- try {
- while ((s = br.readLine()) != null) {
- //System.out.println(s);
- words = s.split(" ");
- for (int i = 0; i < words.length; i++) {
- flag = words[i].length();
- if (flag >= 7) {
- ch = words[i].charAt(0);
- ch1 = words[i].charAt(flag - 1);
- if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
- if (ch1 == 'a' || ch1 == 'e' || ch1 == 'i' || ch1 == 'o' || ch1 == 'u') {
- System.out.println(words[i]);
- }
- }
- }
- }
- }
- } catch(IOException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement