#include <iostream>
#include <algorithm>
#include "vector"
using namespace std;
vector<int> sortedSquares(vector<int>& A)
{
vector<int>::iterator it;
for (it = A.begin(); it != A.end(); it++)
{
(*it) *= *it;
}
sort(A.begin(), A.end());
return A;
}
int main()
{
vector<int>A;
A.push_back(-7);
A.push_back(-3);
A.push_back(2);
A.push_back(3);
A.push_back(11);
sortedSquares(A);
vector<int>::iterator it;
for (it = A.begin(); it != A.end(); it++)
{
cout << *it<<" ";
}
system("pause");
return 0;
}