No Rules Rules

별 찍기 - 1 (feat. 백준, 2438번) 본문

생활/코테

별 찍기 - 1 (feat. 백준, 2438번)

개발하는 완두콩 2022. 8. 10. 11:54
728x90
반응형

별 찍기 - 1
https://www.acmicpc.net/problem/2438

 

2438번: 별 찍기 - 1

첫째 줄에는 별 1개, 둘째 줄에는 별 2개, N번째 줄에는 별 N개를 찍는 문제

www.acmicpc.net

 

반응형

 

// woohyeon.kim
// kim519620.tistory.com
#include <iostream>
using namespace std;
int main() {
	ios::sync_with_stdio(false), cin.tie(NULL);
	register int N;
	cin >> N;
	for (register int n = 1, i; n <= N; ++n) {
		for (i = 1; i <= n; ++i)
			cout << "*";
		cout << "\n";
	}
	return 0;
}
// *&)*@*

문제의 규칙에 맞게 '*'을 출력하는 문제입니다.

728x90
반응형
Comments