adspace
A suduco given & u hv 2 check if it is incomplete(blanks
left),or correct or incorrect
Answer Posted / Mohd Ehtishamul Haque
In C++, you can't directly solve a Sudoku puzzle. However, here's a simple way to check if a given Sudoku grid has any blanks (assuming the input is a 2D vector of integers):n```cppn#include <iostream>n#include <vector>nusing namespace std;nnbool isComplete(vector<vector<int>> sudoku) {n for (int i = 0; i < 9; ++i) {n for (int j = 0; j < 9; ++j) {n if (sudoku[i][j] == 0) return false;n }n }n return true;n}nnint main() {n vector<vector<int>> sudoku {{1, 2, 3, 4, 5, 6, 7, 8, 9}, {6, 7, 8, 4, 5, 9, 1, 2, 3}, {3, 5, 1, 2, 8, 4, 9, 6, 7}, {9, 1, 7, 3, 6, 2, 5, 4, 8}, {4, 8, 9, 1, 7, 5, 6, 3, 2}, {2, 6, 4, 5, 3, 1, 8, 7, 9}, {5, 9, 6, 6, 4, 7, 3, 8, 4}, {8, 3, 2, 9, 1, 8, 7, 5, 6}, {7, 4, 8, 8, 9, 6, 4, 1, 5}}n cout << isComplete(sudoku) << endl;n return 0;n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++