Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package paka;
- import java.util.*;
- public class App1 {
- public static void main(String[] args) {
- Set<String> set1 = new HashSet<String>();
- // Map<String, Integer> map1 = new HashMap<String, Integer>();
- Scanner sc = new Scanner(System.in);
- String słowo;
- while(sc.hasNext())
- {
- słowo = sc.next();
- if (słowo.equals("exit"))
- {
- System.out.println("Pozdrawiam");
- break;
- }
- if(słowo.endsWith("a")||słowo.endsWith("e") || słowo.endsWith("y") || słowo.endsWith("i") || słowo.endsWith("o")|| słowo.endsWith("u"))
- {
- System.out.println(słowo+ " konczy sie na jedna z samoglosek, dodaje do kontenera ");
- set1.add(słowo);
- }
- if(słowo.equals("show"))
- {
- // System.out.println(set1);
- break;
- }
- System.out.println("Wpisano słowo: " + słowo);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement