题目内容

上网就是浪费时间。

A. TheInternetisawasteoftime.
B. TheInternetistowasteoftime.
C. TheInternetistowastetimes.

查看答案
更多问题

学生必须听老师和父母的话。

A. Studentsmustlistentowhattheirparentsandteachers.
B. Studentsmustlistentotheirparentsandteachers.
C. Studentsmustlistentheirparentsandteachers.

我父母没有时间和我说话。

A. Myparentsdon’thavemuchtimetotalkwithme
B. Myparentsdon’thavemuchtimetotalktome.
C. Myparentsdon’thavemuchtimetotalkaboutme

回溯算法采用了的思想,与枚举的思路类似。

补充下列程序(数独):board = [[5,3,0,0,7,0,0,0,0],[6,0,0,1,9,5,0,0,0],[0,9,8,0,0,0,0,6,0],[8,0,0,0,6,0,0,0,3],[4,0,0,8,0,3,0,0,1],[7,0,0,0,2,0,0,0,6],[0,6,0,0,0,0,2,8,0],[0,0,0,4,1,9,0,0,5],[0,0,0,0,8,0,0,7,9]]def checkBoard(i,j,num):for t in range(9):if t!=j and board[i][t] == num:return Falseif t!= i and board[t][j] == num:return Falsefor t in range(i-i%3, 3+i-i%3):for s in range(j-j%3, 3+j-j%3):if t!=i and s!=j and board[t][s] ==num:return Falsereturn Trueres = []import copydef helper(index):if index==:solution= copy.deepcopy(board)res.append(solution)i =j =if :for num in range(1,10):board[i][j] = numif checkBoard(i,j,num):helper(index+1)else:helper(index+1)

答案查题题库