1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
void get_data (double &a, double &b, double &c);
void swap (double &x, double &y);
void order (double &a, double &b, double &c);
void get_data (double &a, double &b, double &c)
{
cout<< "Enter three integers: \n";
cin>>a>>b>>c;
}
void swap (double &x, double &y)
{
double temp;
temp = x;
x = y;
y = temp;
}
void order (double &a, double &b, double &c)
{
if (a<b)
swap (a, b);
if (c<a)
swap (a, c);
if (b<a)
swap (b,a);
}
int main()
{
double a, b, c;
get_data(a,b,c);
order(a, b, c);
cout << a << endl;
cout << b << endl;
cout << c << endl;
return 0;
}
|