PS/BaekJoon

public class Main { public static void main(String[] args) { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String sdfD = sdf.format(date); System.out.println(sdfD); } } Date์— ๊ด€ํ•œ ์ฝ”๋“œ๋ฅผ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ๋‹ค์‹œ ๋ณต์Šตํ•˜๊ณ ์ž ๋ธ”๋กœ๊ทธ์— ๊ธ€์„ ๋‚จ๊ธด๋‹ค.
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long n = scanner.nextLong(); long j = scanner.nextLong(); System.out.println(Math.abs(j-n)); scanner.close(); } } ์ ˆ๋Œ“๊ฐ’์— ๋Œ€ํ•œ ๋ฌธ์ œ๋ฅผ ํ’€์—ˆ๋‹ค. int ๋ฐ์ดํ„ฐ ํƒ€์ž…์„ ์‚ฌ์šฉํ•ด์„œ ๋ฌธ์ œ๋ฅผ ํ’€์—ˆ๋Š”๋ฐ, ์ ˆ๋Œ“๊ฐ’์œผ๋กœ ๊ฑฐ๋ฆฌ๋ฅผ ๊ตฌํ•˜๋Š” ๋ฌธ์ œ์ด๋‹ค๋ณด๋‹ˆ N, M์„ ํ•ฉ์นœ ๊ฑฐ๋ฆฌ๋Š” int ์ด์ƒ์˜ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ํ•„์š”ํ•˜๋‹ค. (long) import java.util.Scanner; public class Main { public static void main(Stri..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); if(n>=0 && n
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int x = scanner.nextInt(); int y = scanner.nextInt(); int x1 = x/y; int y1 = x%y; System.out.println(x1); System.out.println(y1); scanner.close(); } } ๋ฌธ์ œ๋ฅผ ๋ณด๊ณ  ์ œ์ถœ์„ ํ–ˆ๋Š”๋ฐ, ๊ณ„์† ๋Ÿฐํƒ€์ž„ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ๋‹ค. ๋ถ„๋ช… ํ‹€๋ฆด๋ฆฌ๊ฐ€ ์—†๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๊ธฐ ๋•Œ๋ฌธ์—, ๋ฌธ์ œ๋ฅผ ๋‹ค์‹œ ์‚ดํŽด๋ณด์•˜๋‹ค. ๋ฌธ์ œ๋ฅผ ํ™•์ธํ•˜๋‹ˆ ์•„์ฃผ ํฐ ์ˆซ์ž๋ฅผ ๋„ฃ์–ด์•ผํ•œ๋‹ค๋Š” ๊ฒƒ์ด์—ˆ๋‹ค. int, long ๋ณด๋‹ค ํฐ ์ˆ˜๋ฅผ ๋„ฃ์„..
chaerlo127
'PS/BaekJoon' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (4 Page)