answersLogoWhite

0

Use a multiset to sort the input automatically.

int main()

{ std::multiset<int> set;

int i;

while (std::cin >> i)

set.insert (i);

for (auto it=set.begin(); it!=set.end(); ++it)

std::cout << i << std::endl;

}

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

How you can write a program in c plus plus to input values in a table and sort these values in ascending order also print result on screen?

it is really easy when you think about it...first of al you press start and go down to open. you find your hard drive and double click and click on the correct piece of work :) hope i helped :) xx


Put in order smallest first 6.6 2.9 3.4 5.8 3.1?

When the smallest value is then followed by higher values in order this is called "ascending order". In ascending order the values are : 2.9, 3.1, 3.4, 5.8, 6.6


How to Sort values in ascending order in java?

// If your values are stored in an array... Arrays.sort(valuesArray); // If they're stored in a List... Collections.sort(valuesList);


What dos medium mean in maths?

It is the middle value of a set of values set out in ascending order.


Does ascending mean smallest to biggest?

Yes, ascending typically refers to arranging items in order from smallest to largest. When numbers or values are in ascending order, they increase in magnitude as you move from left to right. This is the opposite of descending order, where items are arranged from largest to smallest.


How do you display 15 numbers in an ascending order using an array?

Sort the array then traverse the array, printing the element values as you go.


What is generally correct about the relation between the mode median and mean?

Of a set of data the mode is the most, the median is the middle value in ascending order and the mean is the sum of the values divided by the number of values.


What is the median of a set of numbers if the set of numbers is even?

To find the median of a set of values with an even number of values, place the values in ascending or descending order, find the 2 middle numbers and add them together and divide that total by 2 and that's the median.


What relations is NOT a functionan ascending linea descending linea horizontal line a vertical line?

a vertical line is not a function because the x-values repeat!


What is the meridian in a group of figures?

Meridian is not a term used in that area of maths; you may be confused with the median, the middle value when all values are placed in ascending order.


How the data is viewed in a JSP in the form of table?

You can display data in Tabular format in a JSP page using the HTML &lt;Table&gt; Tag. You can even assign dynamic values to the table using JSP Scriptlets. &lt;% %&gt;


A program is a?

List of instructions (and values that's needed) for your computer.