728x90

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

😢 단순 출력 문제

😊 1개부터 입력 받는 숫자만큼 1개씩 증가하는 별 출력

#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false), cin.tie(nullptr);
int n;
cin >> n;
for (int row = 0; row < n; row++) {
for (int col = 0; col <= row; col++) {
cout << '*';
}
cout << '\n';
}
}
view raw 2438.cpp hosted with ❤ by GitHub

+ Recent posts