+ 12
🎅🎅(CHALLENGE)🎅🎅 Write a program that splits the user input. Follow the instructions below.
The program should split the user input, whether numbers or letters, individually, separated with commas, but with exception of those in bracket. EXAMPLE : user_input = 12(d4)e(1)ta(.) OUTPUT :1,2,d4,e,1,t,a,. ---- user_input = I(am)25df(jeid)(158) OUTPUT: I, am, 2,5,d,f,jeid,158 ALL LANGUAGES ARE WELCOME. I hope Python will rule😁😉. LET'S DO IT.
13 ответов
+ 10
Nice work guys. But guess what, Python is Dominating!!!!
+ 9
congrats, to you, all codes are fixed
+ 8
Nice work guys. I'm only having problems with Yuri and Ferhat, your codes aren't doing what I said its meant to do. Check it, debug and tell me when you're done. Well to all.😁
+ 6
My take using Java
https://code.sololearn.com/cEn7sgnruvmP/?ref=app
+ 6
My try in c++:
https://code.sololearn.com/c36BCJryyLum/#cpp
㋡
+ 4
Here's my try
https://code.sololearn.com/c3N93r91BCd6/?ref=app
+ 4
https://code.sololearn.com/c6F72Xe3f36j/?ref=app
+ 2
here with regex
https://code.sololearn.com/cF0U51H5IbZ5/?ref=app
+ 1
I try
+ 1
Perl:
@s = split /\((.*?)\)/, shift;
for ($i=0; $i<@s;) {
push @l, split(//, $s[$i++]), $s[$i++];
}
print join ",", @l;