techie1991 26 Junior Poster in Training

@rpdm read my post again, it's the implementation of the same algo.
And remember:
1. chalson wanted to get the numbers as input, so you won't require the time() and srand() and the inclusion of header files <cstdlib> and <ctime>
2. The values required are float, not integers.
3. your main() should return a value.

rpdm commented: All bad points. Thanks for assuming I'm an idiot. +0
techie1991 26 Junior Poster in Training

Can someone tell me the algorithm used by the functions sorted() and

  • .sort()?
techie1991 26 Junior Poster in Training

@above repliers with all regards...Sorry to say, but you must keep in mind the level of person when answering...
The above solutions are using STL which come a way ahead in programming in C++
A more simple way is to:

ifstream f;
f.open("filename",ios::in);
char a[15];
while(!f.eof())
f>>a;

The above code reads from the file a word of max length 15 and puts it into the string "a". The line: f>>a, tells the compiler to read from file till a white space is encountered.
For more info, go to:
http://www.bgsu.edu/departments/compsci/docs/read.html

Fbody commented: spammer +0
jonsca commented: C'mon +0