Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
tabeliran polinom
program tabeliranjepolinoma; type niz=array[1..100] of integer; var n,i:integer; a:niz; procedure tabelirajpolinom(a:niz;n:integer); var xmin,xmax,dx,x,p:real; begin writeln('Unesite min i max vrijednost x: '); read(xmin,xmax); writeln('Unesite korak x: '); read(dx); writeln(' x p(x) '); writeln('==========================='); x:=xmin; while (x<=xmax) do begin p:=0.0; for i:=1 to n do p:=p+a[i]*exp((n-i+1)*ln(x)); writeln(' ',x:0:2,' ',p:0:2,' '); x:=x+dx; end end; procedure ispisipolinom(a:niz;n:integer); var i:integer; begin writeln('Polinom je :'); if (n=1) then writeln(a[1]) else begin if(a[1]=1) then write('x^',n) else if(a[1]=-1) then write('-x^',n) else write(a[1],'x^',n); for i:=2 to n-1 do if(a[i]>0) then if(a[i]<>1) then write('+',a[i],'x^',n-i+1) else write('+','x^',n-i+1) else if(a[i]<0) then if(a[i]<>-1) then write(a[i],'x^',n-i+1) else write('-x^',n-i+1); if(a[n]>0) then if(a[n]<>1) then write('+',a[n],'x') else write('+x') else if (a[n]<0) then if (a[n]<>-1) then write(a[n],'x') else write('-x'); if(a[n+1]>0) then write('+',a[i+1]) else if(a[n+1]<0) then write(a[i+1]) end; writeln() end; begin writeln('Unesite stepen polinoma: '); read(n); if(n<0) then writeln('Neispravan unos!') else begin writeln('Unesite koeficijente polinoma: '); for i:=1 to n+1 do read(a[i]); ispisipolinom(a,n); writeln(); tabelirajpolinom(a,n) end end.
run
|
edit
|
history
|
help
0
Triangle.pas
nomer9
practica 2 ejercicio 6
zadacha5
Primo1
числа с несовпадающими цифрами
Урок 4 задача 6
печать символов
Huong11a2@
practica 9 ejercicio 9 BETA