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
Evgen [1.6K]
3 years ago
6

Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The fi

rst integer indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers.
Ex:

If the input is: 5 10 4 39 12 2

the output is: 2 4 10 12 39

For coding simplicity, follow every output value by a space, including the last one. Your program must define and call the following function. When the SortArray function is complete, the vector passed in as the parameter should be sorted. void SortVector(vector& myVec)
Computers and Technology
1 answer:
kozerog [31]3 years ago
7 0

Answer:

see explaination

Explanation:

#include <iostream>

#include <vector>

using namespace std;

void vector_sort(vector<int> &vec) {

int i, j, temp;

for (i = 0; i < vec.size(); ++i) {

for (j = 0; j < vec.size() - 1; ++j) {

if (vec[j] > vec[j + 1]) {

temp = vec[j];

vec[j] = vec[j + 1];

vec[j + 1] = temp;

}

}

}

}

int main() {

int size, n;

vector<int> v;

cin >> size;

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

cin >> n;

v.push_back(n);

}

vector_sort(v);

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

cout << v[i] << " ";

}

cout << endl;

return 0;

}

You might be interested in
In Windows-based systems, a value that specifies the rights that are allowed or denied in an access control entry (ACE) of an ac
blsea [12.9K]

Answer:

C. Access mask discretionary.

Explanation:

Access_Mask is the value that defines the rights used in access control entries (ACE), this value identifies if the trustee is allowed to access a secured object.

It can define rights in three categories: Standard, specific and generic rights.

4 0
3 years ago
In an object-oriented approach, functions used to carry out subtasks are also called ____.
kotegsom [21]
<span>In object-oriented approach, functions used to carry out subtasks are also called "helper" functions, because they are usually used by other functions in the object to complete "sub-tasks". Functions are also known as â€methods’. When the task to be carried out by an object is complicated, it is preferable to break it into subtasks or subroutines. It is accomplished by helper functions. They may or may not accept data and may or may not return a value.</span>
6 0
4 years ago
Air bags expand at up to __________ mph. A. 70 B. 100 C. 150 D. 200
almond37 [142]
Airbags expand
D. 200 mph
7 0
3 years ago
Of what is famous Ted Nelson?​
dsp73

Answer:

Nelson proposed a system where copying and linking any text excerpt, image or form was possible.

Explanation:

Ted Nelson is one of the theoretical pioneers of the world wide web who is best known for inventing the concept of hypertext and hypermedia in the 1960s. As one of the early theorists on how a networked world would work.

How I know:

I goggle it.

8 0
3 years ago
Take some time to do some research about small businesses in your area. Select one and using HTML design a simple site that educ
lina2011 [118]

Answer:

All you have to do is whright about it

Explanation:

3 0
3 years ago
Other questions:
  • How to write equal to or greater than in word?
    9·1 answer
  • You work as the Network Administrator for Perfect solutions Inc. The company has a Linux- based Network. You are a root user on
    15·1 answer
  • Which form of Internet communication would a consumer seek out if they wanted to get personal perspectives into a company and it
    15·1 answer
  • What technology standard is commonly used today for hard drives?
    13·1 answer
  • CC stand for.....in the email platform?
    12·2 answers
  • U
    11·1 answer
  • How does design influence the product's function?
    5·1 answer
  • How does science impact the technology?
    8·2 answers
  • a customer is traveling to a branch office, and the network administrator provides her with a static ip address for her laptop.
    8·1 answer
  • Briefly describe the function of options in a linux command and give an example of a useful option.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!