diff options
author | pommicket <pommicket@gmail.com> | 2022-11-08 11:28:32 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-11-08 11:28:32 -0500 |
commit | ed5510d1bb6ac41639de5b1138b1cf0dbf040d29 (patch) | |
tree | c4c0f0284552b5af34afed310f8eab2af36f55bd /tests | |
parent | e9a14c133f5fcb1f9b68e166e397782bb3de51d8 (diff) |
c++ working except for cout,cin
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cpp.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/cpp.cpp b/tests/cpp.cpp index bc5ae7d..3662ca4 100644 --- a/tests/cpp.cpp +++ b/tests/cpp.cpp @@ -1,22 +1,25 @@ #include <vector> -#include <iostream> +#include <fstream> #include <algorithm> #include <climits> extern "C" int main() { std::vector<int> numbers = {}; + std::ofstream cout("/dev/stdout"); + std::ifstream cin("/dev/stdin"); +// while (1) { int n = INT_MIN; - std::cin >> n; + cin >> n; if (n == INT_MIN) break; numbers.push_back(n); } - //std::sort(numbers.begin(), numbers.end()); - + std::sort(numbers.begin(), numbers.end()); +// for (int n: numbers) - std::cout << n << std::endl; + cout << n << std::endl; exit(0); } |