这js是真的难写啊!!!!!!
https://www.acwing.com/problem/content/729/
let fs = require('fs');
let buf = '';
process.stdin.on('readable', function() {
let chunk = process.stdin.read();
if (chunk) buf += chunk.toString();
});
process.stdin.on('end', function() {
buf=parseInt(buf);
let star=1;
let space=parseInt(buf/2);
let ans="";
for(let i=0;i<buf;i++)
{
for(let j=0;j<space;j++)ans+=" ";
for(let j=0;j<star;j++)ans+="*";
if(i!=buf-1)ans+="\n";
if(i<parseInt(buf/2))space--,star+=2;
else space++,star-=2;
}
console.log(ans);
});
标签:process,chunk,stdin,727,菱形,let,parseInt,buf From: https://www.cnblogs.com/lxl-233/p/17080013.html