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
klasskru [66]
3 years ago
15

IN C++ PLEASE!!! Read integers from input and store each integer into a vector until -1 is read. Do not store -1 into the vector

. Then, output all values in the vector that are greater than zero in reverse order, each on a new line.
Ex: If the input is -19 34 -54 65 -1, the output is:

65
34

#include
#include
using namespace std;

int main() {

/* Your solution goes here */

return 0;
}
Computers and Technology
1 answer:
ololo11 [35]3 years ago
6 0
#include
#include
using namespace std;

int main(){

int input[] = {-19, 34, -54, 65, -1};
std::vector voutput:
std::vector vinput (input, input + sizeof(input) / sizeof(int) );

for (std::vector::iterator it = vinput.begin(); it != vinput.end(); ++it)
if(*it > 0) voutput.insert(voutput.begin(), *it);
for(std::vector::iterator it = voutput.begin(); it < voutput.end(); ++it)
std::cout << *it << ‘\n’ ;

return 0;
}
You might be interested in
Randall is unhappy because the server at his college blocks some emails with attachments, so he is unable to receive a particula
tatiyna
If the school has age restrictions it can read 18+ content but it depends on the school. Viruses as by my past experiences with friends can transfer from anywhere to another place because it disables security connections.

The answer is A.
8 0
3 years ago
Read 2 more answers
These commands are established by combatant commanders when authorized by the Secretary of Defense through the Chairman of the J
Romashka-Z-Leto [24]

Answer:

b. Combatant Command

Explanation:

The Combatant commands are commands which are primarily authorized by the Secretary of Defense with approval from the President. They are then executed by the Combatant Commanders (CCDR's), who receive information from the higher authorities through the Chairman of the Joint Chiefs of Staff. The combatant commanders head the combatant commands and are usually four-star Generals. The combatant commands have a broad and continuing purpose.

They ensure synergy for the command and control of the United States military forces. They are formed on the basis of geography or function. The United States Defense Department has eleven (11) combatant commands which serve either a geographic or functional purpose.

8 0
4 years ago
Gary frequently types his class assignment. His ring automatically types the letter O. What is Gary using when he types?
Solnce55 [7]
The answer would be C
8 0
4 years ago
Read 2 more answers
What is a feature of Print Preview? Fit to Document Fit to Margin Fit to Page Fit to Size
Rudiy27
Fit to page! Is a feature that
7 0
3 years ago
Read 2 more answers
Why is it important to stand clear and not touch the person while the AED is analyzing or defibrillating?
galben [10]

Answer:

Because you could also receive shock

Explanation:

Automatic external defibrillators can help save lives during sudden cardiac arrest.

Do not touch the person while the AED is analyzing; touching or moving the person can affect the analysis. You or another person could be injured by shock. And you could prevent the AED from analyzing your heart rate correctly.

5 0
3 years ago
Other questions:
  • You are going to interview a small business owner about creating a database for his sandwich shop and bakery. Make a list of que
    10·1 answer
  • The total number of errors divided by the total number of bits transmitted is the definition of __________. committed informatio
    14·1 answer
  • How long would you need to work at McDonalds to earn enough money to buy a optiplex 3050, monitor, mouse and keyboard all from d
    7·2 answers
  • Which of the following is a valid SQL statement? a. c.customer#, order#, orderdate, shipdate FROM customers c NATURAL JOIN order
    13·1 answer
  • Quick SearchLinks to an external site. lets you refine or narrow your search results using links on the right side of the screen
    5·1 answer
  • Which option will you use to expose your presentation to the audience
    11·2 answers
  • Which of the following are cloud computing resources?
    12·2 answers
  • The following program is suppose to use the sin() function in the math library and write out an input's absolute value over an i
    12·1 answer
  • Suppose that we want to enhance the processor used for Web serving. The new processor is 10 times faster on computation in the W
    6·1 answer
  • What kind of company would hire an Information Support and Service employee?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!