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
Sabtu, 24 Desember 2011
program modus
program modus;
uses wincrt;
var i,n,j,a :integer;
jumlah:real;
hitung, x,modus: array [1..100] of real;
begin
readln (n);
for i:=1 to n do
readln (x[i]);
begin
for i:=1 to n do
for j:=i+1 to n do
if (x[i]>x[j]) then
begin
a:=x[i];
x[i]:=x[j];
x[j]:=a;
end;
jumlah:=0;
begin
for i:=1 to n-1 do
begin
for j:=1+i to n do
if x[i]=x[j] then hitung [i]:=hitung[i]+1 else if (hitung [i]>hitung[jumlah]) then
begin
jumlah:=hitung(x[i]);
modus:=(x[i]);
end;
end;
writeln ('modus= ',modus,'jumlah data= ',jumlah);
end;
end.
uses wincrt;
var i,n,j,a :integer;
jumlah:real;
hitung, x,modus: array [1..100] of real;
begin
readln (n);
for i:=1 to n do
readln (x[i]);
begin
for i:=1 to n do
for j:=i+1 to n do
if (x[i]>x[j]) then
begin
a:=x[i];
x[i]:=x[j];
x[j]:=a;
end;
jumlah:=0;
begin
for i:=1 to n-1 do
begin
for j:=1+i to n do
if x[i]=x[j] then hitung [i]:=hitung[i]+1 else if (hitung [i]>hitung[jumlah]) then
begin
jumlah:=hitung(x[i]);
modus:=(x[i]);
end;
end;
writeln ('modus= ',modus,'jumlah data= ',jumlah);
end;
end.
Jumat, 16 Desember 2011
1311100020
Fakultas Ilmu Pengetahuan Alam, Jurusan Statistika, Angkatan 2011, Prodi S1, dengan nomor pendaftaran 20..
itulah arti angka ini..
angka yang menyertaiku menggapai mimpi-mimpiku di kampus perjuangan Institut Teknologi Sepuluh Nopember.. ^^
itulah arti angka ini..
angka yang menyertaiku menggapai mimpi-mimpiku di kampus perjuangan Institut Teknologi Sepuluh Nopember.. ^^
Selasa, 13 Desember 2011
program bintang segitiga sama kaki
program pp;
uses wincrt;
var n,i,j :integer;
begin
readln (n);
for i:=n downto 1 do
begin
for j:=1 to n do
begin
if (j<i) then write (' ') else
write ('*');
end;
writeln;
end;
end.
uses wincrt;
var n,i,j :integer;
begin
readln (n);
for i:=n downto 1 do
begin
for j:=1 to n do
begin
if (j<i) then write (' ') else
write ('*');
end;
writeln;
end;
end.
penjumlahan angka ganjil
program penjumlahan_angka ganjil;
uses wincrt;
var i,j,n,sum :integer;
begin
readln (n);
begin
if n=1 then write ('1') else
if n>1 then
begin
for i:=n downto 2 do
begin
sum:=1;
j:=(2*i-1);
write (j,'+');
sum:=sum+j;
end;
writeln (1,'=',sum);
end;
end;
end.
uses wincrt;
var i,j,n,sum :integer;
begin
readln (n);
begin
if n=1 then write ('1') else
if n>1 then
begin
for i:=n downto 2 do
begin
sum:=1;
j:=(2*i-1);
write (j,'+');
sum:=sum+j;
end;
writeln (1,'=',sum);
end;
end;
end.
program bintang berbentuk belah ketupat
program bintang_belahketupat;
uses wincrt;
var i,j,n,t,r :integer;
begin
readln (n);
t:=n div 2;
for r:=1 to n do
begin
if (r=t) then
begin
for i:=t downto 1 do
begin
for j:=2*t-1downto 1 do
begin
if ((j<i) or (j>(2*t-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end
else
if r=t+1 then
begin
for i:=1 to t do
begin
for j:=1 to 2*t-1 do
begin
if ((j<i) or (j>(2*t-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end;
end;
end.
uses wincrt;
var i,j,n,t,r :integer;
begin
readln (n);
t:=n div 2;
for r:=1 to n do
begin
if (r=t) then
begin
for i:=t downto 1 do
begin
for j:=2*t-1downto 1 do
begin
if ((j<i) or (j>(2*t-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end
else
if r=t+1 then
begin
for i:=1 to t do
begin
for j:=1 to 2*t-1 do
begin
if ((j<i) or (j>(2*t-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end;
end;
end.
program matrik
program matrik;
uses wincrt;
type data = array[1..10,1..10] of real;
var matrikI,matrikII : data;
baris,kolom,pil : integer;
procedure isimatrik;
var i,j : integer;
begin
writeln('Penentuan ORDO MATRIK I');
write('Masukan banyak baris matrik I = ');readln(baris);
write('Masukan banyak kolom matrik I = ');readln(kolom);
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
readln(matrikI[i,j]);
end;
clrscr;
writeln('Penentuan ORDO MATRIK II');
write('Masukan banyak baris matrik II = ');readln(baris);
write('Masukan banyak kolom matrik II = ');readln(kolom);
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
readln(matrikII[i,j]);
end;
end;
procedure jumlahmatrik(m1,m2 : data);
var hasil : data;
i,j : integer;
begin
for i:=1 to baris do
for j:=1 to kolom do
begin
hasil[i,j]:=m1[i,j]+m2[i,j];
end;
clrscr;
writeln('Hasil Penjumlahan MATRIK');
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
write(hasil[i,j]);
end;
end;
procedure kurangmatrik(m1,m2 : data);
var hasil : data;
i,j : integer;
begin
for i:=1 to baris do
for j:=1 to kolom do
begin
hasil[i,j]:=m1[i,j]-m2[i,j];
end;
clrscr;
writeln('Hasil Pengurangan MATRIK');
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
write(hasil[i,j]);
end;
end;
procedure kalimatrik(m1,m2 : data);
var hasil : data;
i,j,z : integer;
begin
for i:=1 to baris do
for j:=1 to kolom do
begin
hasil[i,j]:=0;
for z:=1 to baris do
hasil[i,j]:=hasil[i,j]+matrikI[i,z]*matrikII[z,j];
end;
clrscr;
writeln('Hasil Perkalian MATRIK');
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
write(hasil[i,j]);
end;
end;
begin
writeln(' M E N U');
writeln('(1) Penjumlahan Matrik');
writeln('(2) Pengurangan Matrik');
writeln('(3) Perkalian Matrik');
write('Pilihan = ');readln(pil);
clrscr;
case pil of
1 : begin
isimatrik;
jumlahmatrik(matrikI,matrikII);
end;
2 : begin
isimatrik;
kurangmatrik(matrikI,matrikII);
end;
3 : begin
isimatrik;
kalimatrik(matrikI,matrikII);
end;
end;
end.
uses wincrt;
type data = array[1..10,1..10] of real;
var matrikI,matrikII : data;
baris,kolom,pil : integer;
procedure isimatrik;
var i,j : integer;
begin
writeln('Penentuan ORDO MATRIK I');
write('Masukan banyak baris matrik I = ');readln(baris);
write('Masukan banyak kolom matrik I = ');readln(kolom);
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
readln(matrikI[i,j]);
end;
clrscr;
writeln('Penentuan ORDO MATRIK II');
write('Masukan banyak baris matrik II = ');readln(baris);
write('Masukan banyak kolom matrik II = ');readln(kolom);
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
readln(matrikII[i,j]);
end;
end;
procedure jumlahmatrik(m1,m2 : data);
var hasil : data;
i,j : integer;
begin
for i:=1 to baris do
for j:=1 to kolom do
begin
hasil[i,j]:=m1[i,j]+m2[i,j];
end;
clrscr;
writeln('Hasil Penjumlahan MATRIK');
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
write(hasil[i,j]);
end;
end;
procedure kurangmatrik(m1,m2 : data);
var hasil : data;
i,j : integer;
begin
for i:=1 to baris do
for j:=1 to kolom do
begin
hasil[i,j]:=m1[i,j]-m2[i,j];
end;
clrscr;
writeln('Hasil Pengurangan MATRIK');
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
write(hasil[i,j]);
end;
end;
procedure kalimatrik(m1,m2 : data);
var hasil : data;
i,j,z : integer;
begin
for i:=1 to baris do
for j:=1 to kolom do
begin
hasil[i,j]:=0;
for z:=1 to baris do
hasil[i,j]:=hasil[i,j]+matrikI[i,z]*matrikII[z,j];
end;
clrscr;
writeln('Hasil Perkalian MATRIK');
for i:=1 to baris do
for j:=1 to kolom do
begin
gotoxy(j*10,i*5);
write(hasil[i,j]);
end;
end;
begin
writeln(' M E N U');
writeln('(1) Penjumlahan Matrik');
writeln('(2) Pengurangan Matrik');
writeln('(3) Perkalian Matrik');
write('Pilihan = ');readln(pil);
clrscr;
case pil of
1 : begin
isimatrik;
jumlahmatrik(matrikI,matrikII);
end;
2 : begin
isimatrik;
kurangmatrik(matrikI,matrikII);
end;
3 : begin
isimatrik;
kalimatrik(matrikI,matrikII);
end;
end;
end.
Langganan:
Postingan (Atom)