Java

백준

[JAVA] 백준 2753번 윤년

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); Integer a = scanner.nextInt(); if (a%4==0){ if (a%100!=0 || a%400==0) { System.out.println("1"); }else { System.out.println("0"); } }else { System.out.println("0"); } }}

백준

[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] 백준 2558번 A+B-2

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(); System.out.println(a+b); } }

백준

[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..

DEV장화
'Java' 태그의 글 목록 (18 Page)