본문 바로가기

백준(Baekjoon)36

[백준] 2446번: 별 찍기 - 9 -자바 https://www.acmicpc.net/problem/2446 2446번: 별 찍기 - 9 첫째 줄부터 2×N-1번째 줄까지 차례대로 별을 출력한다. www.acmicpc.net [문제] [코드] import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i = 0; i < N; i++) { for(int j = 0; j < i; j++) System.out.print(" "); for(int k = i; k < N*2-(i+1); k++) System.out.print("*"); Sys.. 2022. 4. 2.
[백준] 2445번: 별 찍기 - 8 - 자바 https://www.acmicpc.net/problem/2445 2445번: 별 찍기 - 8 첫째 줄부터 2×N-1번째 줄까지 차례대로 별을 출력한다. www.acmicpc.net [문제] [코드] import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i = 0; i < N; i++) { for(int j=0; j 2022. 4. 1.
[백준] 1267번: 핸드폰 요금 - 자바 https://www.acmicpc.net/problem/1267 1267번: 핸드폰 요금 동호가 저번 달에 이용한 통화의 개수 N이 주어진다. N은 20보다 작거나 같은 자연수이다. 둘째 줄에 통화 시간 N개가 주어진다. 통화 시간은 10,000보다 작거나 같은 자연수이다. www.acmicpc.net [문제] [코드] import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int c; int Y = 0, M = 0; for(int i = 0; i < N; i++) { c = sc.nextInt();.. 2022. 3. 31.
[백준] 별 찍기 - 7- 자바 https://www.acmicpc.net/problem/2444 2444번: 별 찍기 - 7 첫째 줄부터 2×N-1번째 줄까지 차례대로 별을 출력한다. www.acmicpc.net [문제] [코드] import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i = 1; i i; j--) System.out.print(" "); for(int k = 0; k < i*2-1; k++) System.out.print("*"); System.out.println(); } for(int i = N;.. 2022. 3. 29.