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 12:10
1. declare a constant named cents_per_pound and initialize with 25. 2. get the shipping weight from user input storing the weight into shipweightpounds. 3. using flat_fee_cents and cents_per_pound constants, assign shipcostcents with the cost of shipping a package weighing shipweightpounds.
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
Technician a says that a shop towel should never be used to clean around the flange area before replacing an automatic transmission filter. technician b says that a dimpled transmission fluid pan can be repaired. who is right
Answers: 3
question
Computers and Technology, 23.06.2019 09:20
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
question
Computers and Technology, 24.06.2019 02:20
Peter is thinking of a number which isless than 50. the number has 9 factors.when he adds 4 to the number, itbecomes a multiple of 5. what is thenumber he is thinking of ?
Answers: 1
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
Questions on the website: 13722359