1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Maurinko [17]
3 years ago
15

You are given two arrays of integers a and b of the same length, and an integer k . We will be iterating through array a from le

ft to right, and simultaneously through array b from right to left, and looking at pairs (x, y), where x is from a and y is from b Such a pair is called tiny if the concatenation xy is strictly less than k. Your task is to return the number of tiny pairs that you'll encounter during the simultaneous iteration through a and b.
Computers and Technology
1 answer:
rodikova [14]3 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main(){

   int arr1[5], arr2[5], k = 7;

   arr1 = {1,3,5,3,6}

   arr2 = {1,3,2,4,4}

   int reverseA2[5];

   for (int x = 5; x > 0; x++){

       reverseA2[5-x] = arr2[x-1];

   }

   for (int i = 0; i < 5; i++){

       if ( arr1[i] + reverseA2[i] < k){

           cout<< arr1[i] << " , "<<reverseA2[i];

       }

   }

}

Explanation:

The C++ source code prints a pair of values from the arr1 and reverse arr2 arrays whose sum is less than the value of the integer variable value k.

You might be interested in
Add Try/Catch error checking To make sure that the user enters valid values in your program. To catch negative values passed to
ryzh [129]

Answer:

int main()

{

 cout<<"Enter the size of array\n";

 int n;

 try{

 cin>>n;//get size of array

 if (n > 0){

 List list;//make object of list class

 try{

     list.init(n);//initialize the list

     list.fillData();//fill the data

     list.print();//print the data

     list.sortData();//sort the  data

     cout<<"\n--- After sorting the data---\n";

     list.print();//print the data

     cout<<"Enter the element to search\n";

     int x;

     cin>>x;//get element to search

     list.searchElement(x);//call the search function

 }

 catch (std::bad_alloc){

   cout<<"Sorry, could not allocate memory for list object.";

 }

 }else{

   throw('Negative Number detected');

 }

 }

 catch (int n){

   cout<<"The number should be a positive integer.";

 }

   return 0;

}

Explanation:

The try and catch keywords come in pairs, as they are used to control exceptions in the C++ source code. The try keyword checks for error in the source code given the condition (if the n integer variable is greater than 0). If the condition is met, the code in the try code block runs otherwise the catch keyword catches the error of a negative number (if the n variable in less than 0).

4 0
2 years ago
For some people , alcohol can cause an uncontrollable blank of the eyes , making good vision almost impossible
ss7ja [257]
The statement above wil be completed.

For some people, alcohol can cause an uncontrollable vibration to the eyes, making good vision almost impossible. This vibration is called nystagmus or the eyes getting dizzy and shaky. This nystagmus occurs when a person drinks too much and reaches his limit in alcohol intake.
7 0
3 years ago
The destructor automatically executes when the class object goes out of ____.
Tema [17]

Answer:

scope    

Explanation:

Destructor is a member function and it call automatically when the class object goes out of scope.

Out of scope means, the program exit, function end etc.

Destructor name must be same as class name and it has no return type.

syntax:

~class_name() { };

For example:

class xyz{

  xyz(){

        print(constructor);

   }

~xyz(){

        print(destructor);

   }

}

int main(){

    xyz num;

   

}//end program

when the object is create the constructor will called and when the program end destructor will call automatically.

4 0
3 years ago
Which job role requires you to create user guides for computer products and services?
kipiarov [429]

For plato I think technical writer is the answer.

Technical writer: As a technical writer, you’ll create user manuals and support guides for a number of computer products and services. You may also develop content to market technical products online.

4 0
3 years ago
Read 2 more answers
How do companies use LinkedIn ?
Semenov [28]

Answer:

  1. Introducing new products or services you’ve developed.
  2. Differentiating yourself from your competitors.
  3. Finding job candidates who can make a significant contribution to your business success.
  4. Checking on what your competition is doing.
  5. Improving your ranking in search engines.
8 0
3 years ago
Read 2 more answers
Other questions:
  • HELP NOW PLZZ/ Question: Complete the sentence with the correct response.
    11·1 answer
  • What should you do before you share your information on the Internet? A. Ask a trusted adult to make sure it is safe. B. Check t
    13·1 answer
  • 2.8 Code Practice: Question 2
    11·1 answer
  • Which of the following operation is not performed by a mouse 1) left click , middle click , right click, double click​
    15·2 answers
  • which statement is true? O A Future games will be more context oriented. OB. Future games will be more product driven. Future ga
    13·2 answers
  • How are Earth's plates made?
    14·1 answer
  • Name:
    11·1 answer
  • One way to initiate a file download from a web page is to
    8·1 answer
  • Edhesive 9.3 code practice
    11·1 answer
  • Types of digital divide ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!