program rincianuang_soal3_okky;
uses WinCrt;
uses WinCrt;
const
nilai_rupiah:array [1..8] of longint = (100000,50000,20000,10000,5000,2000,1000,500);
var
a,b,c,d:integer;
begin
writeln('=====Selamat Datang di Program Rincian Transaksi=====');
writeln(' OKKY SORAYA-111221111-SEMESTER 2D');
writeln;
write ('Input : Rp. '); readln (c);
write ('Bayar : Rp. '); readln (a);
writeln;
b:=a-c;
for d:=0 to 8 do
begin
if b div nilai_rupiah[d]>0 then
begin
writeln(b div nilai_rupiah[d],' lembar uang Rp. ',nilai_rupiah[d]);
b:=b mod nilai_rupiah[d];
end;
end;
end.
nilai_rupiah:array [1..8] of longint = (100000,50000,20000,10000,5000,2000,1000,500);
var
a,b,c,d:integer;
begin
writeln('=====Selamat Datang di Program Rincian Transaksi=====');
writeln(' OKKY SORAYA-111221111-SEMESTER 2D');
writeln;
write ('Input : Rp. '); readln (c);
write ('Bayar : Rp. '); readln (a);
writeln;
b:=a-c;
for d:=0 to 8 do
begin
if b div nilai_rupiah[d]>0 then
begin
writeln(b div nilai_rupiah[d],' lembar uang Rp. ',nilai_rupiah[d]);
b:=b mod nilai_rupiah[d];
end;
end;
end.
Tidak ada komentar:
Posting Komentar