본문 바로가기

백준32

[백준/JAVA] 1110번 더하기 사이클 import java.util.Scanner; public class Main {public static void main(String args[]) {Scanner in = new Scanner(System.in);int N = in.nextInt();int first, second, temp1,result;int count = 0;first = N / 10;second = N % 10;while (true) {count++;temp1 = first + second;result = second * 10 + temp1 % 10;first = second;second = temp1 % 10;if(result == N)break;}System.out.println(count++);}} 더 많은 백준 코드가 .. 2020. 7. 21.
[백준/JAVA] 10871번 X보다 작은 수 import java.util.Scanner; public class Main {public static void main(String args[]) {Scanner in = new Scanner(System.in);int N, X, input;N = in.nextInt();X = in.nextInt(); for (int i = 0; i < N; i++) {input = in.nextInt();if (input < X) {System.out.print(input + " ");}}}}더 많은 백준 코드가 보고 싶다면 ? https://chuinggun.tistory.com/category/%EB%B0%B1%EC%A4%80 2020. 7. 21.
[백준/JAVA] 8393번 합 import java.io.IOException;import java.util.Scanner; public class Main {public static void main(String args[]) throws IOException {Scanner in = new Scanner(System.in);int input = in.nextInt();int sum = 0;for (int i = 1; i 2020. 7. 21.
[백준/JAVA] 2439번 별찍기 import java.io.IOException;import java.util.Scanner; public class Main {public static void main(String args[]) throws IOException {Scanner in = new Scanner(System.in);int input = in.nextInt();for (int i = 1; i i; k--) {System.out.print(" ");}for (int j = 0; j < i; j++) {System.out.print("*");}System.out.println();}}} 더 많은 백준 코드가 보고 싶다면 ? https://chuinggun.tistory.com/category/%EB%B0%B1%EC%A4%80 2020. 7. 21.