Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <list>
- #include <cmath>
- using namespace std;
- int main() {
- string line;
- getline(cin, line);
- istringstream ss(line);
- list<int> numbers;
- int number;
- while (ss >> number) {
- numbers.push_back(number);
- }
- numbers.sort();
- for (auto i = numbers.rbegin(); i != numbers.rend(); i++) {
- if ((double)sqrt(*i) == (int)sqrt(*i)) {
- cout << *i << ' ';
- }
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement