Skip to content

Instantly share code, notes, and snippets.

@keehyun2
Created January 18, 2018 10:05
Show Gist options
  • Select an option

  • Save keehyun2/2dfa58ef1195a646851f2a78a8278e96 to your computer and use it in GitHub Desktop.

Select an option

Save keehyun2/2dfa58ef1195a646851f2a78a8278e96 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var N = Number(fs.readFileSync('/dev/stdin'));
// window OS - C:\dev\stdin 파일을 만들고 입력 값을 미리 저장해야함...
var str = '';
for (var i = 0; i < N; i++) {
for (var j = 0; j < N ; j++) {
if (j < i) {
str += ' ';
} else {
str += '*';
}
}
str += '\n';
}
console.log(str);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment