From 0351ff512496f1e1655b422ee4e09722eec63aa7 Mon Sep 17 00:00:00 2001 From: yjshin229 <78634177+yjshin229@users.noreply.github.com> Date: 2021年11月22日 18:30:48 -0500 Subject: [PATCH] =?UTF-8?q?week3=20=EB=AA=A8=EC=9D=98=EA=B3=A0=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../3354円243円274円354円260円250円/mathTest.java" | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 "YoungjinShin/3354円243円274円354円260円250円/mathTest.java" diff --git "a/YoungjinShin/3354円243円274円354円260円250円/mathTest.java" "b/YoungjinShin/3354円243円274円354円260円250円/mathTest.java" new file mode 100644 index 0000000..1e10676 --- /dev/null +++ "b/YoungjinShin/3354円243円274円354円260円250円/mathTest.java" @@ -0,0 +1,53 @@ +import java.util.*; + + +public class mathTest{ + public static void main(String[] args){ + Scanner sc = new Scanner(System.in); + int testCase = sc.nextInt(); + int[] answer = new int[testCase]; + for(int i = 0; i tempanswer = new ArrayList(); + + int max = Arrays.stream(ansCount).max().getAsInt(); + + for (int i = 0; i < ansCount.length; i++){ + if (ansCount[i] == max){ + tempanswer.add(i+1); + } + } + int[] answer = tempanswer.stream().mapToInt(i -> i).toArray(); + + return answer; + } +} \ No newline at end of file

AltStyle によって変換されたページ (->オリジナル) /