我用呢個軟件做一d數學的程式
當我寫到總和and乘積公式如下:
6:writeln('Sum or Product of Sequence');
writeln;
writeln('(1)Sum');
writeln('(2)Product');
write('Type applied is ');
readln(seq);
If (seq=1) then goto Sum;
If (seq=2) then goto Prod;
Sum: writeln('Type 1 applying');
write('i= ');
readln(V);
write('n= ');
readln(N);
Mem:=0;
Repeat W:=V;
Mem:=W+Mem;
V:=V+1;
until V>N;
writeln('The sum of the sequence=',Mem:0:8,'.');
write('Finished? ');
readln(Last);
If ((Last = finished)or(Last = finish)) then exit
else goto Start;
Prod: writeln('Type 2 applying');
write('i= ');
readln(V);
write('n= ');
readln(N);
Mem:=1;
Repeat W:=V;
Mem:=W*Mem;
V:=V+1;
until V>N;
writeln('The product of the sequence=',Mem:0:8,'.');
write('Finished? ');
readln(Last);
If ((Last = finished)or(Last = finish)) then exit
else goto Start;
這是我一個非常大的程式中的一部份~關於Lbl,:real果d無任何問題。我發覺每次想計一個數列的總和or乘積都要更改以上紅色的位置。究竟可否在執行此程式前輸入
N N
Σ(W) orΠ(W) 的W的定義,即係V V*V果d
i(V) i(V)