Integers are read from input and stored into a vector until- −1 is read. For each vector element E, output the result of
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Integers are read from input and stored into a vector until- −1 is read. For each vector element E, output the result of
Integers are read from input and stored into a vector until- −1 is read. For each vector element E, output the result of subtractir the vector's last element from E. End each number with a newline. Ex: If the input is −9.1519−1, the vector's last element is 9. Thus, the output is: −18−24−80 Note: - The input has at least three integers. - A vector's back0 function returns the vector's last element. Ex. myvector.back0 1 Hincluae 3 using namespace std: 4 5 int main(){ 6 int i; 7 vectorcints integervector; 8 int value; 10 cin so value: 11 while (value 1=−1 ) 1 12. Integervector, push_bock(value); 13 cin → value; using mankspace star. 14−13 16 In your code goes here "
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!