BOJ | 2438번

송치헌·2021년 6월 11일
0
post-thumbnail

Python 풀이

import sys

N = int(input())

for i in range(1, N+1):
    print('*'*i)

C++ 풀이

#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
    	for (int j = 1; j <= i; j++) {
    		cout << "*";
    	}
        cout << '\n';
    }
}
profile
https://oraange.tistory.com/ 여기에도 많이 놀러와 주세요

0개의 댓글