We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
small_leaf
作業檢討:Project5 LIOJ 1046:圈圈叉叉
嘗試使用影片中的解法,在 LIOJ 中卻顯示 RE
輸入 sample 的答案是顯示預期的答案,應該要顯示 AC
var readline = require('readline'); const { timeEnd } = require('console'); const { UV_FS_O_FILEMAP } = require('constants'); const { isIPv4 } = require('net'); const { doesNotReject } = require('assert'); const { isRegExp, isDeepStrictEqual } = require('util'); const { stringify } = require('querystring'); const { realpathSync } = require('fs'); const { NOTIMP } = require('dns'); var lines = [] var rl = readline.createInterface({ input: process.stdin }); rl.on('line', function (line) { lines.push(line) }); rl.on('close', function() { solve(lines) }) function solve(lines) { console.log(whoWin(lines)) } function whoWin(lines){ for(let i = 0; i< 3;i++){ if(lines[i][0] === lines[i][1] && lines[i][1] === lines[i][2]){ return lines[i][0] } } for(let i = 0; i< 3;i++){ if(lines[0][i] === lines[1][i] && lines[1][i] === lines[2][i]){ return linesp[0][i] } } if(lines[0][0] === lines[1][1] && lines[1][1] === lines[2][2]){ return lines[0][0] } if(lines[0][2] === lines[1][1] && lines[1][1] === lines[2][0]){ return lines[0][2] } return "DRAW" }
The text was updated successfully, but these errors were encountered:
因為你第二個迴圈打錯字了:return linesp[0][i]
return linesp[0][i]
Sorry, something went wrong.
No branches or pull requests
slack 帳號
small_leaf
作業名稱
作業檢討:Project5 LIOJ 1046:圈圈叉叉
碰到的問題
嘗試使用影片中的解法,在 LIOJ 中卻顯示 RE
預期的行為
輸入 sample 的答案是顯示預期的答案,應該要顯示 AC
相關程式碼
The text was updated successfully, but these errors were encountered: