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
lana [24]
3 years ago
11

Read integers from input and store each integer into a vector until -1 is read. Do not store -1 into the vector. Then, output al

l values in the vector (except the last value) with the last value in the vector subtracted from each value. Output each value on a new line. Ex: If the input is -46 66 76 9 -1, the output is:
-55
57
67
Computers and Technology
1 answer:
weqwewe [10]3 years ago
6 0

Answer:

The program in C++ is as follows:

#include <iostream>

#include <vector>

using namespace std;

int main(){

vector<int> nums;

int num;

cin>>num;

while(num != -1){

 nums.push_back(num);

 cin>>num; }  

for (auto i = nums.begin(); i != nums.end(); ++i){

    cout << *i <<endl; }

return 0;

}

Explanation:

This declares the vector

vector<int> nums;

This declares an integer variable for each input

int num;

This gets the first input

cin>>num;

This loop is repeated until user enters -1

while(num != -1){

Saves user input into the vector

 nums.push_back(num);

Get another input from the user

 cin>>num; }

The following iteration print the vector elements

<em> for (auto i = nums.begin(); i != nums.end(); ++i){ </em>

<em>     cout << *i <<endl; } </em>

You might be interested in
The picture that graphically represents the items you use in Windows is called a/an
Fofino [41]
Icon need to use 20  characters <span />
7 0
3 years ago
10^4+10-2=<br>10^4+10-2=
yaroslaw [1]
10008 is the answer to your question
4 0
3 years ago
Read 2 more answers
In which of the following situations may you pass on the right
Natasha2012 [34]
In driving your vehicle, it is best to pass on the right after you slow your vehicle down and check for the road whether there is an upcoming vehicle or not. When the road is clear, it is best and safe to pass on the right after making sure that the coast is clear.
3 0
3 years ago
Read 2 more answers
In 2000, operating a basic internet application cost businesses approximately _____ per month. In mid-2016, operating the same a
anyanavicka [17]

Answer:

In 2000, a basic internet application cost businesses approximately $150,000 per month. In mid-2016, operating the same application in Amazon's cloud cost approximately $1,000 per month.

Explanation:

The role of cloud services cannot be overemphasized. Providing Infrastructure as a service (IaaS), Platform as a service (PaaS) and Software as a service (SaaS) cost a lot as there were very few cloud service providers and most services were yet to be integrated to the cloud.

But as at 2016, the cost on applications dropped as we have experienced an exponential growth in cloud services and applications, we now have Internet of Things (IoT) and other cloud infrastructure.

4 0
3 years ago
____ are types of changes that occur when text has been omitted from a document and must be inserted later.
VMariaS [17]
You already wrote the answer. It is Additions
7 0
3 years ago
Other questions:
  • What are smart mobile devices
    11·1 answer
  • At the beginning of this month, the balance of Reed's checking account was $692.35. So far this month, he has received a paychec
    13·2 answers
  • What names of websites of presentation or visualization <br>​
    15·1 answer
  • Nina aspires to be a digital media specialist. What should Nana be familiar with in order to pursue this career?
    9·2 answers
  • is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources th
    9·1 answer
  • Ivy is a student. She is looking for some freelance assignments during her vacation. Which of the following networking sites can
    9·1 answer
  • If you are involved in a collision that results in property damage, injury, or death, you must call
    13·1 answer
  • Tcp takes a three-step approach to establishing a reliable communication. first, from the transport layer of the sending device
    12·1 answer
  • Select the correct word to complete the sentence
    11·2 answers
  • William brought some data into his Tableau Book, but the data had some null values and incorrect column headers. What did Willia
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!