Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <complex>
- typedef std::complex<double> Kompleksni;
- bool Manji(Kompleksni x, Kompleksni y)
- {
- return std::arg(x)<std::arg(y);
- }
- int main()
- {
- std::cout<<"Unesi broj elemenata: ";
- int n;
- std::cin>>n;
- std::vector<Kompleksni> v(n);
- std::cout<<std::endl<<"Unesi kompleksne brojeve:"<<std::endl;
- for(int i=0; i<n; i++)
- std::cin>>v[i];
- std::sort(std::begin(v), std::end(v), Manji);
- for(int i=0; i<n; i++)
- std::cout<<v[i]<<" ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement