tempat BERJUANG
About Me
- arista WHIE
- hai.. welcome to my blog... namaku wiwik.. Asli BALI.. aku kuliah di ITS jurusan STATISTIKA.. NRP 1311100020.. silahkan menikmati blogku.. see it n' enjoy it... semoga bermanfaat... kalau ad kurang g usah sungkan kasi komentar ya..
Diberdayakan oleh Blogger.
Pengikut
Jumat, 25 November 2011
program laurin (by mas iwan asdos pik s1 statistika 2011 A)
program laurin ;
uses wincrt;
var
x,y:array[1..1000] of real;
i,j,n:longint;
a,sum,p:real;
begin
readln(n);
readln(a);
sum:=0;
for i:=1 to n do
begin
x[i]:=-1/i;
p:=1;
for j:=1 to i do
p:=p*a;
y[i]:=p;
sum:=sum+x[i]*y[i];end;
writeln('hasil= ',sum:0:5);
writeln('asli= ',ln(1-a):0:5);
writeln('error= ',ln(1-a)-sum:0:5);
end.
uses wincrt;
var
x,y:array[1..1000] of real;
i,j,n:longint;
a,sum,p:real;
begin
readln(n);
readln(a);
sum:=0;
for i:=1 to n do
begin
x[i]:=-1/i;
p:=1;
for j:=1 to i do
p:=p*a;
y[i]:=p;
sum:=sum+x[i]*y[i];end;
writeln('hasil= ',sum:0:5);
writeln('asli= ',ln(1-a):0:5);
writeln('error= ',ln(1-a)-sum:0:5);
end.
program memanggil suatu data
program muncul;
uses wincrt;
var
x: array[1..100] of string;
i,n,z:integer;
begin
write('Masukkan banyak hari : ');readln(n);
writeln;
for i:=1 to n do
begin
write ('hari ke ',i,' = ');
readln (x[i]);
end;
begin
writeln;
write ('hari yang diinginkan= '); readln (z);
write ('Hari ke ' ,z,' adalah ',x[z]);
end;
end.
uses wincrt;
var
x: array[1..100] of string;
i,n,z:integer;
begin
write('Masukkan banyak hari : ');readln(n);
writeln;
for i:=1 to n do
begin
write ('hari ke ',i,' = ');
readln (x[i]);
end;
begin
writeln;
write ('hari yang diinginkan= '); readln (z);
write ('Hari ke ' ,z,' adalah ',x[z]);
end;
end.
Sabtu, 19 November 2011
program-program baru
program plus2;
uses wincrt;
var i,n:integer;
rata,vars,jml,jml1, sd, max, min, range:real;
x:array [1..100] of real;
begin
readln (n);
if n<0 then write ('tidak terdefinisi') else if n>0 then
begin
for i:=1 to n do
readln (x[i]);
begin
jml:=0;
for i:=1 to n do
jml:=jml+(x[i]);
rata:=jml/n;
writeln ('rata-rata= ',rata);
end;
begin
jml1:=0;
for i:=1 to n do
jml1:=jml1+((x[i]-rata)*(x[i]-rata));
vars:=jml1/(n-1);
writeln ('varian= ',vars);
end;
begin
sd:= sqrt (vars);
writeln ('standar deviasi= ',sd);
end;
begin
max:= (x[i]);
min:=(x[i]);
for i:=1 to n do
if (x[i]) > max then max:=(x[i])
else if (x[i]) < min then min :=(x[i]);
writeln ('nilai minimum= ',min);
writeln ('nilai maksimum= ',max);
range:= max-min;
writeln ('range= ',range);
end;
end;
end.
uses wincrt;
var i,n:integer;
rata,vars,jml,jml1, sd, max, min, range:real;
x:array [1..100] of real;
begin
readln (n);
if n<0 then write ('tidak terdefinisi') else if n>0 then
begin
for i:=1 to n do
readln (x[i]);
begin
jml:=0;
for i:=1 to n do
jml:=jml+(x[i]);
rata:=jml/n;
writeln ('rata-rata= ',rata);
end;
begin
jml1:=0;
for i:=1 to n do
jml1:=jml1+((x[i]-rata)*(x[i]-rata));
vars:=jml1/(n-1);
writeln ('varian= ',vars);
end;
begin
sd:= sqrt (vars);
writeln ('standar deviasi= ',sd);
end;
begin
max:= (x[i]);
min:=(x[i]);
for i:=1 to n do
if (x[i]) > max then max:=(x[i])
else if (x[i]) < min then min :=(x[i]);
writeln ('nilai minimum= ',min);
writeln ('nilai maksimum= ',max);
range:= max-min;
writeln ('range= ',range);
end;
end;
end.
Kamis, 03 November 2011
program bintang2
program bintang;
uses wincrt;
var i,j,n :integer;
begin
readln (n);
for i:=2*n-1 downto 1 do
begin
for j:=n downto 1 do
begin
if ((j>i) or (j>(2*n-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end.
uses wincrt;
var i,j,n :integer;
begin
readln (n);
for i:=2*n-1 downto 1 do
begin
for j:=n downto 1 do
begin
if ((j>i) or (j>(2*n-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end.
program faktorial
program fakto;
uses wincrt;
var i,n,f :integer;
begin
f:=1;
readln(n);
for i:=n downto 2 do
begin
write (i,'x');
f:=i*f;
end;
if n<0 then write ('tidak terdefinisikan') else
write (1,'=',f);
end.
uses wincrt;
var i,n,f :integer;
begin
f:=1;
readln(n);
for i:=n downto 2 do
begin
write (i,'x');
f:=i*f;
end;
if n<0 then write ('tidak terdefinisikan') else
write (1,'=',f);
end.
Langganan:
Postingan (Atom)