program cari_and
kamus
c1,c2,cc : char
pitaChar:string
ci,jumand:integer
procedure start_couple
procedure adv_couple
algoritma
input(pitaChar)
start_couple
jumand<--0
while (cc<>'.')do begin
if (c1='a' and c2 ='n') then begin
adv_couple
if c2='d' then
jumand<--jumand + 1
end
adv_couple
end
output(jumand)
{end of program}
procedure start_couple
{I.S : semua variabel yang digunakan kosong}
{F.S : semua variabel terisi kecuali c1}
kamus lokal
algoritma
ci<--1
cc<--pitaChar[ci]
c1<--''
c2<--cc
{end of procedure}
procedure adv_couple
{I.S : semua variabel terisi kecuali c1}
{F.S : semua variabel terisi}
kamus lokal
algoritma
ci<--ci + 1
cc<--pitaChar[ci]
c1<--c2
c2<--cc
{end of procedure}
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar