Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <vector>
- #include <set>
- using namespace std;
- int main() {
- string line;
- getline(cin, line);
- istringstream ss(line);
- set<double> numbers;
- double number;
- while (ss >> number) {
- numbers.insert(number);
- }
- int counter = 0;
- for (auto rit = numbers.rbegin(); rit != numbers.rend(); rit++) {
- if (counter++ == 3) {
- break;
- }
- cout << *rit << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement