https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AX0SaDW6L2oDFASs
์ด๊ฒ ์๋ D3์ธ์ง ๋ชจ๋ฅด๊ฒ ๋ค ,,,,
import java.util.Scanner;
import java.io.FileInputStream;
class Solution
{
public static void main(String args[]) throws Exception
{
Scanner kb=new Scanner(System.in);
int n=kb.nextInt();
int[] answer=new int[n];
String[] arr=new String[n];
for(int i=0; i<n; i++) arr[i]=kb.next();
String[] s={"SUN","MON","TUE","WED","THU","FRI","SAT"};
for(int i=0; i<n; i++){
for(int j=0; j<s.length; j++){
if(arr[i].equals(s[j]))
answer[i]=7-j;
}
}
for(int i=0; i<n; i++) System.out.println("#"+(i+1)+" "+answer[i]);
}
}
'๐ ์ฝ๋ฉํ ์คํธ > ๋ฐฑ์ค & ํ๋ก๊ทธ๋๋จธ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก๊ทธ๋๋จธ์ค][JAVA]Level 1 : ์ฝ๋ผ ๋ฌธ์ (0) | 2022.11.03 |
---|---|
[ํ๋ก๊ทธ๋๋จธ์ค][JAVA]Level 0 : ์ผ๊ฐํ์ ์์ฑ์กฐ๊ฑด(2) (0) | 2022.11.03 |
[ํ๋ก๊ทธ๋๋จธ์ค][JAVA]Level 0 : ์ต๋น๊ฐ ๊ตฌํ๊ธฐ (0) | 2022.11.02 |
[ํ๋ก๊ทธ๋๋จธ์ค][JAVA]Level 1 : ์ผ์ด์ฌ (0) | 2022.11.02 |
[SWEA][JAVA] ์ํ๋ฒณ ๊ณต๋ถ (0) | 2022.11.01 |