Program Ngitung Karakter
3 posters
Page 1 of 1
Program Ngitung Karakter
Periksain Dunks!
TUBES BIKIN RAJIN
Mencari 3 Huruf
Versi 1
Program cariTUB
Kamus
CPTTUB : integer
C1,C2 : CHAR
Algoritma
Start-couple
CPTTUB <- 0
While (CC ≠ ‘.’) do
If (C1 = ‘T’ and C2 =’U') then
ADV-Couple; ADV-Couple
If (C1 = ‘B’) then
CPTTUB <- CPTTUB + 1
ADV-Couple
Output (CPTTUB)
Versi 2
Program cariTUB
Kamus
CPTTUB : integer
Prec-is-T : Boolean
Algoritma :
Prec-Is-T ← false
CPTTUB ← 0
START
while CC ≠ ‘.’ do
Prec-Is-T ← CC = ‘T’
ADV
if CC = ‘U’ and Prec-Is-T then
ADV
If CC = ‘B’ then
CPTTUB = CPTTUB + 1
ADV
Output (CPTTUB)
Mencari 4 Huruf
Versi 1
Program cariUBES
Kamus
CPTUBES : integer
C1,C2 : CHAR
Algoritma
Start-couple
CPTUBES <- 0
While (CC ≠ ‘.’) do
If (C1 = ‘U’ and C2 =’B') then
ADV-Couple ; ADV-Couple
If (C1 = ‘E’ and C2 = ‘S’) then
CPTUBES <- CPTUBES +1
ADV-Couple
Output (CPTUBES)
Versi 2
Program cariUBES
Kamus
CPTUBES : integer
Prec-is-U , Prec-is-E : Boolean
Algoritma :
Prec-Is-U ← false
Prec-Is-E ← false
CPTUBES ← 0
START
while CC ≠ ‘.’ do
Prec-Is-U ← CC = ‘U’
ADV
if CC = ‘B’ and Prec-Is-U then
ADV
Prec-Is-E ← CC = ‘E’
ADV
If CC = ‘S’ and Prec-Is-E then
CPTUBES = CPTUBES + 1
ADV
Output (CPTUBES)
Mencari 5 Huruf
Versi 1
Program cariTUBES
Kamus
CPTTUBES : integer
C1,C2 : CHAR
Algoritma
Start-couple
CPTTUBES <- 0
While (CC ≠ ‘.’) do
If (CC = ‘T’) then
ADV-Couple
If (C1 = ‘U’ and C2 = ‘B’) then
ADV-Couple ; ADV-Couple
If (C1 = ‘E’ and C2 = ‘S’) then
CPTTUBES <- CPTTUBES +1
ADV-Couple
Output (CPTTUBES)
Versi 2
Program cariTUBES
Kamus
CPTTUBES : integer
Prec-is-T , Prec-is-B : Boolean
Algoritma :
Prec-Is-T ← false
Prec-Is-B ← false
CPTTUBES ← 0
START
while CC ≠ ‘.’ do
Prec-Is-T ← CC = ‘T’
ADV
if CC = ‘U’ and Prec-Is-T then
ADV
Prec-Is-B ← CC = ‘B’
ADV
If CC = ‘E’ and Prec-Is-B then
ADV
If CC = S then
CPTTUBES = CPTTUBES + 1
ADV
Output (CPTTUBES)
TUBES BIKIN RAJIN
Mencari 3 Huruf
Versi 1
Program cariTUB
Kamus
CPTTUB : integer
C1,C2 : CHAR
Algoritma
Start-couple
CPTTUB <- 0
While (CC ≠ ‘.’) do
If (C1 = ‘T’ and C2 =’U') then
ADV-Couple; ADV-Couple
If (C1 = ‘B’) then
CPTTUB <- CPTTUB + 1
ADV-Couple
Output (CPTTUB)
Versi 2
Program cariTUB
Kamus
CPTTUB : integer
Prec-is-T : Boolean
Algoritma :
Prec-Is-T ← false
CPTTUB ← 0
START
while CC ≠ ‘.’ do
Prec-Is-T ← CC = ‘T’
ADV
if CC = ‘U’ and Prec-Is-T then
ADV
If CC = ‘B’ then
CPTTUB = CPTTUB + 1
ADV
Output (CPTTUB)
Mencari 4 Huruf
Versi 1
Program cariUBES
Kamus
CPTUBES : integer
C1,C2 : CHAR
Algoritma
Start-couple
CPTUBES <- 0
While (CC ≠ ‘.’) do
If (C1 = ‘U’ and C2 =’B') then
ADV-Couple ; ADV-Couple
If (C1 = ‘E’ and C2 = ‘S’) then
CPTUBES <- CPTUBES +1
ADV-Couple
Output (CPTUBES)
Versi 2
Program cariUBES
Kamus
CPTUBES : integer
Prec-is-U , Prec-is-E : Boolean
Algoritma :
Prec-Is-U ← false
Prec-Is-E ← false
CPTUBES ← 0
START
while CC ≠ ‘.’ do
Prec-Is-U ← CC = ‘U’
ADV
if CC = ‘B’ and Prec-Is-U then
ADV
Prec-Is-E ← CC = ‘E’
ADV
If CC = ‘S’ and Prec-Is-E then
CPTUBES = CPTUBES + 1
ADV
Output (CPTUBES)
Mencari 5 Huruf
Versi 1
Program cariTUBES
Kamus
CPTTUBES : integer
C1,C2 : CHAR
Algoritma
Start-couple
CPTTUBES <- 0
While (CC ≠ ‘.’) do
If (CC = ‘T’) then
ADV-Couple
If (C1 = ‘U’ and C2 = ‘B’) then
ADV-Couple ; ADV-Couple
If (C1 = ‘E’ and C2 = ‘S’) then
CPTTUBES <- CPTTUBES +1
ADV-Couple
Output (CPTTUBES)
Versi 2
Program cariTUBES
Kamus
CPTTUBES : integer
Prec-is-T , Prec-is-B : Boolean
Algoritma :
Prec-Is-T ← false
Prec-Is-B ← false
CPTTUBES ← 0
START
while CC ≠ ‘.’ do
Prec-Is-T ← CC = ‘T’
ADV
if CC = ‘U’ and Prec-Is-T then
ADV
Prec-Is-B ← CC = ‘B’
ADV
If CC = ‘E’ and Prec-Is-B then
ADV
If CC = S then
CPTTUBES = CPTTUBES + 1
ADV
Output (CPTTUBES)
fr4mz_113080019- Posts : 5
Join date : 2008-11-17
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|