program sum;
var j, n: integer;
var x1, y1, x2, y2, theta: real;
begin
write('Please Enter n: ');
readln(n);
write('Please Enter theta: ');
readln(theta);
x1 := cos(theta);
y1 := sin(theta);
x2 := x1;
y2 := y1;
j := 1;
while j <= n do begin
writeln( '(cos theta + i sin theta)', j, '=', x1:8:3, '+ i ', y1:8:3 );
writeln( 'cos', j, 'theta + i sin', j, 'theta =', cos( j * theta ):8:3, sin( j * theta ):8:3 );
x1 := x1 * x2 - y1 * y2;
y1 := x1 * y2 + x2 * y1;
j := j + 1;
end;
readln
end. 38
繰り返し実行される
部分
条件式