Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <queue>
- #include <map>
- using namespace std;
- int main() {
- string line;
- getline(cin, line);
- queue<double> order;
- map<double, int> numbers;
- istringstream ss(line);
- double number;
- while (ss >> number) {
- if (numbers.find(number) == numbers.end()) {
- order.push(number);
- }
- numbers[number]++;
- }
- while (order.size() != 0) {
- cout << order.front() << " - " << numbers[order.front()] << " times" << endl;
- order.pop();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement