2018~2019/Level 1

직사각형 별찍기 [C++, Python3]

전기도둑 2018. 10. 2. 16:57

[C++]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>

using namespace std;

int main(void) {
    int a, b;
    cin >> a >> b;

    for(int i = 0; i < b; i++){
        for(int j = 0; j < a; j++) {
            cout << "*";
        }
        cout << endl;
    }
    return 0;
}



[Python3]

1
2
3
4
5
6
7
a, b = map(int, input().strip().split(' '))

for i in range(b):
    for j in range(a):
        print('*', end='')
    print('')