[PYTHON] 백준 2739 - 구구단

이또삐(이민혁)·2023년 4월 13일

CODINGTEST

목록 보기
7/96
post-thumbnail

성능 요약

메모리: 113112 KB, 시간: 116 ms

분류

수학, 구현

문제 설명

N을 입력받은 뒤, 구구단 N단을 출력하는 프로그램을 작성하시오. 출력 형식에 맞춰서 출력하면 된다.

입력

첫째 줄에 N이 주어진다. N은 1보다 크거나 같고, 9보다 작거나 같다.

출력

출력형식과 같게 N1부터 N9까지 출력한다.

#https://www.acmicpc.net/problem/2739
#구구단
#2739

import sys
input = sys.stdin.readline

a = int(input())

for i in range(1,10):
    result = a*i
    print(a, "*", i, "=", result)
#https://www.acmicpc.net/problem/2739
#구구단
#2739

import sys
input = sys.stdin.readline

n = int(input())

def fun(n):
    global result

    for i in range(1,10):
        result = i * n
        print(n, "*", i, "=", result)

    return

fun(n)
profile
해보자! 게임 클라 개발자!

0개의 댓글