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

11y 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.


How do you create a CBS file from Word?

To create a CBS (Comma-Separated Values) file from a Word document, first, copy the text you want to convert. Then, open a program like Microsoft Excel or a plain text editor such as Notepad. Paste the copied content into the program, ensuring that the data is organized in a tabular format with commas separating values. Finally, save the file with a .csv extension, ensuring that you select the appropriate format if using Excel.


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.


What is an nonexample of asending order?

A nonexample of ascending order would be a list of numbers arranged from highest to lowest, such as 9, 5, 3, 1. In this case, the values decrease rather than increase, which contradicts the definition of ascending order. Ascending order requires elements to be organized from the smallest to the largest.


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 ascending order?

Ascending order refers to the arrangement of numbers, letters, or items from the smallest to the largest or from the lowest to the highest. For numerical values, this means organizing them from the least value to the greatest. In terms of letters or words, ascending order typically involves sorting them alphabetically from A to Z. This method is commonly used in data organization to facilitate easier analysis and retrieval.


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!