Задача House Party - Lists - Exercise - Technology Fundamentals - Java
Здравейте колеги, бихте ли помогнали, защо ми се чупи на един от тестовете:
Решение: https://pastebin.com/nZZnkcAZ
Условие:
1.House Party
Write a program that keeps track of the guests that are going to a house party. On the first input line you are going to receive how many commands you are going to have. On the next lines you are going to receive some of the following inputs:
- “{name} is going!”
- “{name} is not going!”
If you receive the first type of input, you have to add the person if he/she is not in the list. (If he/she is in the list print on the console: “{name} is already in the list!”). If you receive the second type of input, you have to remove the person if he/she is in the list. (if not print: “{name} is not in the list!”). At the end print all the guests.
Examples
Input |
Output |
4 Allie is going! George is going! John is not going! George is not going!
|
John is not in the list! Allie |
5 Tom is going! Annie is going! Tom is going! Garry is going! Jerry is going! |
Tom is already in the list! Tom Annie Garry Jerry |
Малеее благодаря много колега , доста ми помагаш постояно за което съм много благодарен ! Направо бях заравил за .contains....Тцтц :)