알고리즘
[프로그래머스] 직사각형 별찍기 (python/javascript)
MOOB
2022. 1. 12. 11:48
avascript
process.stdin.setEncoding('utf8');
process.stdin.on('data', data => {
const n = data.split(" ");
const a = Number(n[0]), b = Number(n[1]);
for(let i=0; i < b; i++){
let star = ''
for(let j=0; j <a; j++){
star+='*'
}
console.log(star)
}
});
python
a, b = map(int, input().strip().split(' '))
for i in range(b):
star = ''
for i in range(a):
star +='*'
print(star)