0
how to solve this problem?
we input word in 7 variable string in one line. if the input make the word "belalang", output="yes" else "no" example input 1: la be la ng be la ng output 1: yes input 2: la be la ng be la la output 2: no
4 Respuestas
+ 7
Basically you can add a cursor and proceed if you found a matching character by traverse the 7 variable string.
If the cursor reach the end of the string you'll output yes. Here's a simulation:-
➡belalang
[l]a be la ng be la ng
➡belalang
l[a] be la ng be la ng
b➡elalang
la [b]e la ng be la ng
be➡lalang
la b[e] la ng be la ng
bel➡alang
la be [l]a ng be la ng
bela➡lang
la be l[a] ng be la ng
bela➡lang
la be la [n]g be la ng
bela➡lang
la be la n[g] be la ng
bela➡lang
la be la ng [b]e la ng
bela➡lang
la be la ng b[e] la ng
belal➡ang
la be la ng be [l]a ng
belala➡ng
la be la ng be l[a] ng
belalan➡g
la be la ng be la [n]g
belalang➡
la be la ng be la n[g]
0
can you help me make the program please? :)
0
help me make the c++ program about that problemset
- 1
the problem is on my post :) i don't know how to make the program :(