# 程式範例

``````#include <stdio.h>
#include <math.h>

// a+b=3
// 2a+b=5
int main() {
float a=1.0, b=1.0;
int i;
for (i=0; i<100; i++) {
float ta = ((3.0-b)+((5.0-b)/2.0))/2.0;
float tb = ((3.0-a)+(5.0-2.0*a))/2.0;
a = ta;
b = tb;
printf("a=%6.2f b=%6.2f\n", a, b);
}
}```
```

# 執行結果

``````a=  2.00 b=  2.50
a=  0.88 b=  1.00
a=  2.00 b=  2.69
a=  0.73 b=  1.00
a=  2.00 b=  2.90
a=  0.58 b=  1.00
a=  2.00 b=  3.14
a=  0.40 b=  1.00
a=  2.00 b=  3.40
a=  0.20 b=  1.00
a=  2.00 b=  3.70
a= -0.03 b=  1.00
a=  2.00 b=  4.04
a= -0.28 b=  1.00
a=  2.00 b=  4.42
a= -0.57 b=  1.00
a=  2.00 b=  4.85
a= -0.89 b=  1.00
a=  2.00 b=  5.33
a= -1.25 b=  1.00
a=  2.00 b=  5.87
a= -1.65 b=  1.00
a=  2.00 b=  6.48
a= -2.11 b=  1.00
a=  2.00 b=  7.16
a= -2.62 b=  1.00
a=  2.00 b=  7.94
a= -3.20 b=  1.00
a=  2.00 b=  8.80
a= -3.85 b=  1.00
a=  2.00 b=  9.78
a= -4.58 b=  1.00
a=  2.00 b= 10.87
a= -5.41 b=  1.00
a=  2.00 b= 12.11
a= -6.33 b=  1.00
a=  2.00 b= 13.50
a= -7.37 b=  1.00
a=  2.00 b= 15.06
a= -8.55 b=  1.00
a=  2.00 b= 16.82
a= -9.86 b=  1.00
a=  2.00 b= 18.79
a=-11.35 b=  1.00
a=  2.00 b= 21.02
a=-13.01 b=  1.00
a=  2.00 b= 23.52
a=-14.89 b=  1.00
a=  2.00 b= 26.34
a=-17.00 b=  1.00
a=  2.00 b= 29.50
a=-19.38 b=  1.00
a=  2.00 b= 33.07
a=-22.05 b=  1.00
a=  2.00 b= 37.08
a=-25.06 b=  1.00
a=  2.00 b= 41.58
a=-28.44 b=  1.00
a=  2.00 b= 46.66
a=-32.24 b=  1.00
a=  2.00 b= 52.36
a=-36.52 b=  1.00
a=  2.00 b= 58.79
a=-41.34 b=  1.00
a=  2.00 b= 66.01
a=-46.76 b=  1.00
a=  2.00 b= 74.13
a=-52.85 b=  1.00
a=  2.00 b= 83.28
a=-59.71 b=  1.00
a=  2.00 b= 93.56
a=-67.42 b=  1.00
a=  2.00 b=105.13
a=-76.10 b=  1.00
a=  2.00 b=118.15
a=-85.86 b=  1.00
a=  2.00 b=132.79
a=-96.84 b=  1.00
a=  2.00 b=149.27
a=-109.20 b=  1.00
a=  2.00 b=167.80
a=-123.10 b=  1.00
a=  2.00 b=188.65
a=-138.74 b=  1.00
a=  2.00 b=212.10
a=-156.33 b=  1.00
a=  2.00 b=238.49
a=-176.12 b=  1.00
a=  2.00 b=268.18
a=-198.38 b=  1.00
a=  2.00 b=301.58
a=-223.43 b=  1.00
a=  2.00 b=339.15
a=-251.61 b=  1.00
a=  2.00 b=381.42
a=-283.31 b=  1.00
a=  2.00 b=428.97
a=-318.98 b=  1.00
a=  2.00 b=482.47
a=-359.10 b=  1.00```
```