본문 바로가기
728x90
반응형

알고리즘138

2029. 몫과 나머지 출력하기.D1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T= sc.nextInt(); int a=0; int b=0; for(int tc=1;tc 2022. 2. 5.
2043. 서랍의 비밀번호. D1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Solution { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st =new String.. 2022. 2. 5.
2046. 스탬프 찍기.D1 12345678910111213141516import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader; public class Solution { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); for(int i=0;i 2022. 2. 5.
2047. 신문 헤드라인.D1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Solution { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); String strTo=str.toUpperCase(); System.out.println(strTo); } } Colored by Col.. 2022. 2. 5.
2050. 알파벳을 숫자로 변환.D1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Solution{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); for(int i=0;i 2022. 2. 5.
2056. 연월일 달력.D1* 보호되어 있는 글 입니다. 2022. 2. 5.
2058. 자릿수 더하기. D1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int[] intArr = new int[s.length()]; int sum=0; for(int i=0;ichar->int 2. charAt(index): 문자열에서 인덱스별로 문자로 가져오는 3. -'0': 문자를 정수로 만들기 위해선 문자 '0'을 빼주면 된다. 2022. 2. 5.
2063. 중간값 찾기.D1* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Scanner; import java.util.StringTokenizer; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if (n % 2 == 1) { int[] intArr= new int[n]; for (int i = 0.. 2022. 2. 5.
2070. 큰 놈, 작은 놈, 같은 놈.D1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Solution { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System... 2022. 2. 4.
728x90
반응형