English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

what is the best way to do this, please explain the steps. thanks

problem:

input: 3b1w3b

output: bbbwbbb

2007-01-26 00:48:55 · 2 answers · asked by wata_tempora 1 in Computers & Internet Programming & Design

2 answers

I ll give u the logic.
Store the input in an character array.
Run a for loop,
Identify where the numbers are,
When ever there is a number, replace that particular position in array to a character.
Hope this will work.

2007-01-26 05:06:42 · answer #1 · answered by Sudha P 2 · 0 0

the algorithm :
use suitable commands in your program

s=3b1w3b
x=length(s)
for k=1 to x/2
{
for(i=1;i<=s[i];i++)
{
output s[k+1]
}
}


output: bbbwbbb

2007-01-26 02:45:59 · answer #2 · answered by iyiogrenci 6 · 0 0

fedest.com, questions and answers