diff --git a/.idea/java-basic.iml b/.idea/java-basic.iml index d6ebd48..b107a2d 100644 --- a/.idea/java-basic.iml +++ b/.idea/java-basic.iml @@ -2,7 +2,9 @@ - + + + diff --git a/.idea/misc.xml b/.idea/misc.xml index 45b76e1..4444b22 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..d09e9c5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1720605572552 + + + + + + + + + + \ No newline at end of file diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..e8aeaba --- /dev/null +++ b/Main.java @@ -0,0 +1,30 @@ +import java.util.ArrayList; +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int[] miss = new int[]{0,0}; + ArrayList goalkeeper = new ArrayList(); + ArrayList attacker1 = new ArrayList(); + ArrayList attacker2 = new ArrayList(); + + System.out.print("attacker1이 찰 공을 입력해주세요 : "); + attacker1.add(sc.nextLine()); + System.out.print("attacker2가 찰 공을 입력해주세요 : "); + attacker2.add(sc.nextLine()); + System.out.print("goalkeeper가 막을 공을 입력해주세요 : "); + goalkeeper.add(sc.nextLine()); + for(String goal : goalkeeper.get(0).split(",")) { + for(String shoot : attacker1.get(0).split(",")) { + if(shoot.contains(goal)) miss[0] +=1; + } + for(String shoot : attacker2.get(0).split(",")) { + if(shoot.contains(goal)) miss[1] +=1; + } + } + if(miss[0]miss[1]) System.out.println("attacker2 님이 승리하셨습니다."); + else System.out.println("무승부입니다."); + } +} \ No newline at end of file diff --git a/out/production/java-basic/.gitkeep b/out/production/java-basic/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/out/production/java-basic/.idea/java-basic.iml b/out/production/java-basic/.idea/java-basic.iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/out/production/java-basic/.idea/java-basic.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/java-basic/.idea/misc.xml b/out/production/java-basic/.idea/misc.xml new file mode 100644 index 0000000..4444b22 --- /dev/null +++ b/out/production/java-basic/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/out/production/java-basic/.idea/modules.xml b/out/production/java-basic/.idea/modules.xml new file mode 100644 index 0000000..9c68e74 --- /dev/null +++ b/out/production/java-basic/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/out/production/java-basic/.idea/vcs.xml b/out/production/java-basic/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/out/production/java-basic/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/out/production/java-basic/.idea/workspace.xml b/out/production/java-basic/.idea/workspace.xml new file mode 100644 index 0000000..bb63a9c --- /dev/null +++ b/out/production/java-basic/.idea/workspace.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1720605572552 + + + + + + + + + + \ No newline at end of file diff --git a/out/production/java-basic/Main.class b/out/production/java-basic/Main.class new file mode 100644 index 0000000..d9582bd Binary files /dev/null and b/out/production/java-basic/Main.class differ