- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
#include <iostream>
using namespace std;
void f(double *x1,double *x2,double *x3)
{
if (((*x1>*x2)&&(*x1<*x3))||((*x1<*x2)&&(*x1>*x3)))
*x1=(*x2+*x3)/2;
if (((*x2>*x1)&&(*x2<*x3))||((*x2<*x1)&&(*x2>*x3)))
*x2=(*x1+*x3)/2;
if (((*x3>*x1)&&(*x3<*x2))||((*x3<*x1)&&(*x3>*x2)))
*x3=(*x2+*x1)/2;
}
int main()
{
double x1,x2,x3;
cin>>x1>>x2>>x3;
double *y1=&x1;
double *y2=&x2;
double *y3=&x3;
f(y1,y2,y3);
cout<<x1<<' '<<x2<<' '<<x3;
return 0;
}
Nigma143 06.09.2010 14:08 # +6