Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.List;
- public class Ship {
- String [] s;
- public void setS(String[] c){
- s = c;
- }
- public String getit(String z){
- List<String> list = new ArrayList<String>(Arrays.asList(s));
- String result = "Мимо";
- if(list.contains(z)){
- System.out.println("Попал");
- list.remove(z);
- }else if(list.isEmpty()){
- result = "Потопил!";
- }else{
- System.out.println(result);
- }
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement