题解 | #汽水瓶#
汽水瓶
https://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
const rl = require("readline").createInterface({ input: process.stdin }); var iter = rl[Symbol.asyncIterator](); const readline = async () => (await iter.next()).value; void async function () { // Write your code here // solution one while(line = await readline()){ const res = Math.floor(line/2); if(res== 0) continue; console.log(res); } // solution two // for(let i = 0 ; i < 10 ; i++){ // const total = parseInt(await readline()); // if(total) { // let sum = total; // let res = 0; // while(sum >=3) { // const rest = sum % 3; // res += Math.floor(sum / 3); // sum = Math.floor( sum / 3) + rest; // } // if(sum >= 2) res++; // console.log(res) // }else { // break; // } // } }()