[백준] 2739 : 구구단 - Java

길 잃은 까마귀·2022년 9월 13일
0

https://www.acmicpc.net/problem/2739


  • 문제

  • 풀이
    드디어 반복문 시작이다. for문을 이용해 입력 받은 값과 for문의 정수를 차례 대로 곱해 출력하면 된다.

  • 코드
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		for (int i = 1; i < 10; i++) {
			System.out.println(N + " * " + i + " = " + i * N);
		}
		sc.close();
	}
}
profile
코딩 고수가 될 사람

0개의 댓글