백준

백준

[JAVA] 백준 2744번 대소문자 바꾸기

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String a = scanner.nextLine(); char[] res; res = a.toCharArray(); for (int i = 0; i < a.length(); i++) { if (97

백준

[JAVA] 백준 2743번 단어 길이 재기

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String a = scanner.nextLine(); System.out.println(a.length()); } }

백준

[JAVA] 백준 2741번 N찍기

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); for (int i = 1; i

백준

[JAVA] 백준 2739번 구구단

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); for (int i = 1; i < 10 ; i++) { System.out.println(a + " * " + i + " = " + a*i); } } }

백준

[JAVA] 백준 2557번 Hello World

public class Main { public static void main(String[] args) { System.out.println("Hello World!"); } }

백준

[JAVA] 백준 2475번 검증수

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); int b = scanner.nextInt(); int c = scanner.nextInt(); int d = scanner.nextInt(); int e = scanner.nextInt(); int res = (int) ((Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2)+Math.pow(d,2)+Math.pow(e,2))%10); System.out.println(res); } } Math.pow로 a..

백준

[JAVA] 백준 2438번 별 찍기 - 1

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); for (int i = 0; i < a ; i++) { for (int j = 0; j

백준

[JAVA] 백준 2420번 사파리월드

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long a = scanner.nextLong(); long b = scanner.nextLong(); System.out.println(Math.abs(a-b)); } } 절대값을 계산해주는 함수 Math.abs() 함수를 이용하여 계산.

DEV장화
'백준' 카테고리의 글 목록 (17 Page)