SHARE
TWEET

Untitled

a guest Mar 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int sortiranje(){
  5.  
  6. int a,b,c;
  7.  
  8. cout<<"\n Unesite 3 vrijednosti!"<<endl;                                                                                       //Dzeno radio heheh
  9. cin>>a>>b>>c;
  10.  
  11. if(a>b){
  12.     if(a>c){
  13.         cout<<"\n 1. "<<a;
  14.         if(b>c){
  15.             cout<<"\n 2. "<<b<<"\n 3. "<<c;
  16.         }
  17.         if(c>b){
  18.             cout<<"\n 2. "<<c<<"\n 3. "<<b;
  19.         }
  20.     }
  21. }
  22. else if (b>a){
  23.     if (b>c){
  24.         cout<<"\n 1."<<b;
  25.         if(a>c){
  26.             cout<<"\n 2. "<<a<<"\n 3. "<<c;
  27.         }
  28.         if(c>a){
  29.             cout<<"\n 2. "<<c<<"\n 3. "<<a;
  30.         }
  31.     }
  32. }
  33. if (c>a){
  34.     if (c>b){
  35.     cout<< "\n 1. "<<c;
  36.     if(a>b){
  37.         cout<<"\n 2. "<<a<<"\n 3. "<<b;
  38.     }
  39.     if(b>a){
  40.         cout<<"\n 2. "<<b<<"\n 3. "<<a;
  41.     }
  42.  
  43. }
  44. }
  45. }
  46. int main(){
  47.  
  48. sortiranje();
  49.  
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top