0

Help me fix this code

Use another compiler not the SL compiler If you add more to char than once, there will be a problem https://code.sololearn.com/cbzlsWSRra8D/?ref=app

5th Sep 2021, 4:35 AM
Husein
Husein - avatar
10 ответов
+ 2
Do not post your code in the description. Save it in your code bits and attach the link . If you are running this code in SL , then it won't work as you desire as SL takes all input at once.
5th Sep 2021, 5:01 AM
Hima
Hima - avatar
+ 1
If you add more to char y than one, then there will be a problem
5th Sep 2021, 7:32 AM
Husein
Husein - avatar
+ 1
Okay, thanks you Hima
5th Sep 2021, 7:41 AM
Husein
Husein - avatar
+ 1
you should add N char at last Y char on every input such as yyyyyyn
6th Sep 2021, 5:40 AM
shadows knight
shadows knight - avatar
0
The code works fine. What's the issue ?
5th Sep 2021, 7:30 AM
Hima
Hima - avatar
0
Try this input in SL: Y Y Y N
5th Sep 2021, 7:34 AM
Hima
Hima - avatar
0
If you input yyyyyy That would be a problem
5th Sep 2021, 7:36 AM
Husein
Husein - avatar
0
That makes sense as you are not providing the trigger for break condition and this gives you infinite loop.
5th Sep 2021, 7:37 AM
Hima
Hima - avatar
0
So, how to fix this code?
5th Sep 2021, 7:38 AM
Husein
Husein - avatar
0
Always append a n in your input.
5th Sep 2021, 7:39 AM
Hima
Hima - avatar