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
The IT infrastructure components should be evaluated based on their expected financial value. All of the following are used to q
vladimir2022 [97]

Answer:(A) usability

Explanation:

The term usability refers to the usage value of products, how much they can be used and their value after their use. So adding on these points usability helps to quantify the financial value of IT components.

5 0
4 years ago
How to bypas power switch on pc and make it switch on
Andreas93 [3]
If your powersupply has the standard 24 pin connector, you can make it switch on by connecting a green and a black (find a good picture to see the pin numbers). Google for the "paperclip test" for details.
6 0
3 years ago
write a C++ program that requires the user to enter two-digit positive and negative integers . The program counts the number of
ValentinkaMS [17]

Answer:

Use GitHub it helps a lot

Explanation:

4 0
3 years ago
Where do you find southwest's flight schedule on their website
slega [8]

Answer:

Right here : https://www.southwest.com/air/flight-schedules/

Hope this helps! :)

Please mark this answer as brainiest!

Thank you! :)

4 0
3 years ago
You and your best friend have both created online career profiles. Within a week, your friend has had three calls for interviews
mart [117]

Answer:

umm what?

Explanation:

4 0
3 years ago
Other questions:
  • Janelle went to update the last name for one of her group contacts. She double-clicked on the contact, changed the last name, an
    12·2 answers
  • (It science question)
    9·1 answer
  • What so the term used to describe how many bits are used in each pixel?
    7·1 answer
  • Which character formatting effect makes text appear in a small font size below the midpoint of a line of text
    6·1 answer
  • 7.5 Code practice Plz answer ASAP
    15·1 answer
  • Monster Collector
    7·1 answer
  • Who know's web Design
    12·1 answer
  • Types of computer viruses<br>​
    5·2 answers
  • I will have to goste yall im busting my butt off doing homework
    10·2 answers
  • Full meaning of CASE in system analysis
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!