본문 바로가기
728x90
반응형

알고리즘/SWEA23

1938. 아주 간단한 계산기.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 a = sc.nextInt(); int b = sc.nextInt(); System.out.println(a+b); System.out.println(a-b); System.out.println(a*b); System.out.println(a/b); } } Colored by Color Scripter cs 2022. 2. 5.
2025. N줄덧셈.D1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int sum=0; for(int i=n;i>0;i--) { sum+=i; } System.out.println(sum); } } Colored by Color Scripter cs 2022. 2. 5.
2027. 대각선 출력하기.D1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import java.util.Arrays; public class Solution { public static void main(String[] args) { for (int i = 0; i 2022. 2. 5.
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.
728x90
반응형