문제 : https://www.acmicpc.net/problem/2556


[알고리즘풀이]

질문 게시판 보고 유추해서 풀었네요... 이상한 문제입니다.

꽉찬 네모모양을 출력하면 됩니다.

#include <iostream>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            cout << "*";
        }
        cout << "\n";
    }
}

 

+ Recent posts