21 lines
387 B
C++
21 lines
387 B
C++
#include<iostream>
|
|
|
|
float f(float x) {
|
|
if(x >= 0 && x < 0.5) return 2*x;
|
|
else return 2 * (1 - x);
|
|
}
|
|
|
|
float f_chaos(float x) {
|
|
if(x >= 0 && x < 0.5) return 1.999999*x;
|
|
else return 1.999999 * (1 - x);
|
|
}
|
|
|
|
int main() {
|
|
float x = 0.01401;
|
|
std::cout << x << std::endl;
|
|
for (int i = 1; i <= 100; i++) {
|
|
x = f(x);
|
|
std::cout << x << std::endl;
|
|
}
|
|
}
|