, since you seem to be needing help with your homework, I can give you some psuedo code to help you on your way!
[CODE]
DECLARE ARRAY names[10]
FOR i = 0 TO 9
names[i] = READ INPUT FROM USER
ENDFOR
CALL FUNCTION sort WITH PARAMETERS names, 10
[/CODE]
In the event that you have to create your own sorting function, I can give you some pseudo-code for the selection sort - a relatively easy-to-write sorting algorithm which doesn't involve any complicated data structures, or more advanced programming patterns, such as recursion.
[CODE]
FUNCTION sort WITH PARAMETER ARRAY names[], size
FOR i = 0 TO size
min = i
FOR j = i + 1 TO size
//Find the smallest unsorted element in the list
IF names[min] > names[j] THEN min = j
END FOR
SWAP names[i] AND names[min]
END FOR
END FUNCTION
[/CODE]
The above function sorts in ascending order. The smallest element will be located at names[0], and the largest will be at names[size].
If you are allowed to, you may be able to use C's builtin strcmp() function to compare strings (found in #include <string.h>, or #include <cstring> for a C++ compiler). PLEASE REMEMBER that you can not compare strings directly in C!!! A C-string is nothing more than a memory address. If you attempt to compare two strings directly, then the compiler will NOT compare the strings, but the memory addresses where the strings are located! If you can't use strcmp(), you will have to write your own string comparing function.
When reading input from the user, you will need to use scanf() for C. Also remember that C does not do any memory management for you, so you need to make sure you have enough space in your character arrays to read in a string from the user. Because you have multiple names, you will need to create an array of arrays. Something similar to this: "char names[NUMBER_OF_NAMES][CHARACTERS_IN_A_NAME];" where NUMBER_OF_NAMES = 10 and CHARACTERS_IN_A_NAME is an arbitrary number, large enough to store a name (I would pick something like 100).
The 'users' command should do that; you don't need to write a shell script to get that information in that format.
To broadly accept an idea or suggestion, but subject to some smaller issues being sorted out.
where and how is paper sorted? where and how is paper sorted?
You cannot get sorted on that website. However, you can be sorted on Pottermore.
You cannot sort a single value. You need two or more values. In order to display sorted values you first have to sort the values. The simplest way is to use an associative container such as std::set or std::map. If you need to allow duplicates, use std::multiset or std::multimap instead. Data elements are sorted as they are added. The only difference between a set and a map is that a set stores the value as a key, whereas a map associates a value with a key. Once added, the key cannot be changed, so if you need to edit values, use a map. If you need to change a key, you must erase the original key and add a new key.
the well sorted is on the left & the poorly sorted is on the right .. It all depends on the arrangement and size of the rocks
it can be sorted by files kamran :)
sorted
The past participle of "sort" is "sorted." For example, "I have sorted the documents alphabetically."
Living things are sorted intio species
The duration of Sorted - film - is 1.63 hours.
To order the records in the answer to a query in a particular way.