Děkuji mnohokrát za radu. Asi se mi vlastní tělo podařilo napsat, ale zase jsem se zasekl na výpisu těch ekvidistinktně tabelovaných hodnot. Píše mi to hodnotu vždy poslední ):
Příspěvky odeslané z IP adresy 94.112.7.–
sorry, jedná se zde o jina n, a to 3,7 a 33
jaksi dosti prasečina, ale jak říkám, nikdy jsem neprogramoval
program cviceni2;
const n=1000;
q=9;
w=4;
var a:array[1..n] of real;
b:array[1..n] of real;
x:array[1..n] of real;
c:array[1..n] of real;
i:integer;
txt:textfile;
begin
for i:=1 to n do b[i]:= -4 + i*(8/999) - (8/999);
for i:=1 to n do a[i]:=((sin(1)*cos(1*b[i]))/1) + ((sin(2)*cos(2*b[i]))/2) + ((sin(3)*cos(3*b[i]))/3);
for i:=1 to n do x[i]:=((sin(1)*cos(1*b[i]))/1) + ((sin(2)*cos(2*b[i]))/2) + ((sin(3)*cos(3*b[i]))/3) + ((sin(4)*cos(4*b[i]))/4) + ((sin(5)*cos(5*b[i]))/5) + ((sin(6)*cos(6*b[i]))/6) + ((sin(7)*cos(7*b[i]))/7);
for i:=1 to n do c[i]:=((sin(1)*cos(1*b[i]))/1) + ((sin(2)*cos(2*b[i]))/2) + ((sin(3)*cos(3*b[i]))/3) + ((sin(4)*cos(4*b[i]))/4) + ((sin(5)*cos(5*b[i]))/5) + ((sin(6)*cos(6*b[i]))/6) + ((sin(7)*cos(7*b[i]))/7) + ((sin(8)*cos(8*b[i]))/8) + ((sin(9)*cos(9*b[i]))/9) + ((sin(10)*cos(10*b[i]))/10) + ((sin(11)*cos(11*b[i]))/11) + ((sin(12)*cos(12*b[i]))/12) + ((sin(13)*cos(13*b[i]))/13) + ((sin(14)*cos(14*b[i]))/14) + ((sin(15)*cos(15*b[i]))/15) + ((sin(16)*cos(16*b[i]))/16) + ((sin(17)*cos(17*b[i]))/17) + ((sin(18)*cos(18*b[i]))/18) + ((sin(19)*cos(19*b[i]))/19) + ((sin(20)*cos(20*b[i]))/20) + ((sin(21)*cos(21*b[i]))/21) + ((sin(22)*cos(22*b[i]))/22) + ((sin(23)*cos(23*b[i]))/23) + ((sin(24)*cos(24*b[i]))/24) + ((sin(25)*cos(25*b[i]))/25) + ((sin(26)*cos(26*b[i]))/26) + ((sin(27)*cos(27*b[i]))/27) + ((sin(28)*cos(28*b[i]))/28) + ((sin(29)*cos(29*b[i]))/29) + ((sin(30)*cos(30*b[i]))/30) + ((sin(31)*cos(31*b[i]))/31) + ((sin(32)*cos(32*b[i]))/32) + ((sin(33)*cos(33*b[i]))/33);
assignfile(txt,'d:\mff\i.rocnik\zs\programovani\qweqweqwe.txt');
rewrite(txt);
for i:=1 to n do begin
write(txt,b[i]:9:4);
write(txt,a[i]:9:4);
write(txt,x[i]:9:4);
writeln(txt,c[i]:9:4);
end;
closefile(txt)
end.
Zdravim,
mam takovy problem, v pascalu jsem uplny noob a potreboval bych napsat funkci dvou promennych (viz nize) a prohnat ji cca 1000 hodnot x pro n=2;20 a 200. Vysledkem maji byt ekvidistinkne tabelovane hodnoty, pomoci nichz pote budu kreslit graf. umim to vyresit bez pouziti funkce pomoci rad, ale to bohuzel nesplnuje zadani a s tou funkci si lamu hlavu a nemuzu prijit na zadnou rozumnou syntaxi.
diky moc za jakekoli rady!!!