31 lines
455 B
C++
31 lines
455 B
C++
#include <iostream>
|
|
|
|
#include "trace.h"
|
|
|
|
using namespace std;
|
|
|
|
float Saisie_plusgrand(float min) {
|
|
float max;
|
|
|
|
do {
|
|
cout << "Saisir";
|
|
cin >> max;
|
|
} while (max <= min);
|
|
|
|
return max;
|
|
}
|
|
|
|
float f(float x) {
|
|
float y;
|
|
const float PI = 3.141565358979;
|
|
|
|
if (x < 0) {
|
|
y = ((float)3/7) * (cos(x) - 1);
|
|
} else if (x <= 2*PI) {
|
|
y = sin(x) * 2;
|
|
} else {
|
|
y = sin(3*x)/3;
|
|
}
|
|
|
|
return y;
|
|
} |