language: C++11 (gcc-4.7.2)
date: 195 days 15 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <vector>
#include <iostream>
#include <iterator>
#include <algorithm>
 
int main() {
 
        // Open the file
//      std::ifstream file_in("/FilePath.../checkIn.dat");
        
        // Create the vector, initialized from the numbers in the file:
        std::vector<double> fileData((std::istream_iterator<double>(std::cin)),
                                      std::istream_iterator<double>());
 
        std::sort(fileData.begin(), fileData.end());
        std::copy(fileData.begin(), fileData.end(), 
                  std::ostream_iterator<double>(std::cout, "\n"));
        return 0;
}