Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int sortiranje(){
- int a,b,c;
- cout<<"\n Unesite 3 vrijednosti!"<<endl; //Dzeno radio heheh
- cin>>a>>b>>c;
- if(a>b){
- if(a>c){
- cout<<"\n 1. "<<a;
- if(b>c){
- cout<<"\n 2. "<<b<<"\n 3. "<<c;
- }
- if(c>b){
- cout<<"\n 2. "<<c<<"\n 3. "<<b;
- }
- }
- }
- else if (b>a){
- if (b>c){
- cout<<"\n 1."<<b;
- if(a>c){
- cout<<"\n 2. "<<a<<"\n 3. "<<c;
- }
- if(c>a){
- cout<<"\n 2. "<<c<<"\n 3. "<<a;
- }
- }
- }
- if (c>a){
- if (c>b){
- cout<< "\n 1. "<<c;
- if(a>b){
- cout<<"\n 2. "<<a<<"\n 3. "<<b;
- }
- if(b>a){
- cout<<"\n 2. "<<b<<"\n 3. "<<a;
- }
- }
- }
- }
- int main(){
- sortiranje();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement