subject

Write in either C++ or Java Consider a grid of size X by Y where the column index x ranges from 0 to X-1 inclusive and the row index y ranges from 0 to Y-1. the value of any given cell is the polynomial x + y^2. given a value V. count the number of times V appears in the grid. for example, given x = 4, y = 4, and v = 3, the value 3 occurs 2 times in the 4x4 grid. X the width of the grid. Y the height of the grid. V the value to be counted.
test cases:
test 1: input = 1024,1024,83
test 1: output = 10
test 2: input = 5,5,27
test 2: output = 0
test 3: input = 144,12,12
test 3: output = 4
test 4: input = 4,4,3
test 4: output = 2
using the code below:
#include
#include
using namespace std;
int main()
{
string line;
while (getline(cin, line)) {
cout << line << endl;
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Research data that is presented using descriptive language is said to be
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
question
Computers and Technology, 23.06.2019 20:50
3.11.3 quiz: comparing and analyzing function typesquestion 4 of 102 pointswhat can you say about the y-values of the two functions f(x) = 3x2-3 andg(x)=2* - 3?
Answers: 2
You know the right answer?
Write in either C++ or Java Consider a grid of size X by Y where the column index x ranges from 0 t...
Questions
question
Mathematics, 05.11.2020 04:00
question
Biology, 05.11.2020 04:00
question
Mathematics, 05.11.2020 04:00
question
Mathematics, 05.11.2020 04:00