1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| (() => { const iList = [ [16, 9], [5, 4], [5, 3], [4, 3], [3, 2], [3, 1], [2, 1], ]; const wList = [640, 960, 1024, 1280, 1366, 1440]; let strRlt = ""; iList.forEach((i) => { strRlt += "__" + i.join("__x__"); strRlt += `\n(宽 / 高) = ` + i[0] / i[1]; strRlt += "\n"; wList.forEach((w) => { h = (w / i[0]) * i[1]; if (h == parseInt(h)) { strRlt += `${w} x ${h}`; strRlt += "\n"; } }); strRlt += "\n"; }); console.log(strRlt); })();
|