+ 1

No Numerals Code Coach in C#

Hi friends , I want to write No Numerals program in C# language. When I run the code, 3 of the 6 tests it performs are wrong and I can not see what the code error is wrong because it has three locked tests. Does anyone know what I should do? https://code.sololearn.com/c78mL4zCyVZ6/?ref=app

4th Aug 2020, 6:09 AM
Morteza R.g
Morteza R.g - avatar
10 Respuestas
4th Aug 2020, 7:45 AM
Morteza R.g
Morteza R.g - avatar
+ 2
Morteza R.g you are converting input to lower case but you should output in original case.. Dont convert to lower case. Use charecter class method Charecter.isAlpha();
4th Aug 2020, 2:23 PM
Jayakrishna 🇮🇳
+ 2
Thank you, I am modifying the code.
4th Aug 2020, 7:14 PM
Morteza R.g
Morteza R.g - avatar
16th May 2021, 11:18 AM
ACE
ACE - avatar
+ 2
ACE, I'm a little simpler) https://code.sololearn.com/c81FyGzHDvaO
22nd Nov 2021, 1:03 PM
Роман Жигунов
Роман Жигунов - avatar
+ 1
AnonymouS This is very Perfect, Good Luck🌷
16th May 2021, 5:29 PM
Morteza R.g
Morteza R.g - avatar
+ 1
I'm having a similar issue where I got 3 out of 6 examples correct. Here's my code so far. string[] numbers = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"}; string user = Console.ReadLine(); StringBuilder output = new StringBuilder(); int digits = 0; for(int i = 0; i < user.Length; i++) { char element = user[i]; if(char.IsNumber(element)) { digits++; } else if(digits > 0) { int index = i - digits; string word = user.Substring( index, digits ); output.Append( numbers[int.Parse(word)] + element); digits = 0; } else { output.Append(element); }
22nd Oct 2023, 3:20 AM
Martin Jimenez
Martin Jimenez - avatar
0
Martin Jimenez I wrote this program with the help of one of my friends, if you like I can send it to you.🙏🌹
2nd Dec 2023, 10:04 AM
Morteza R.g
Morteza R.g - avatar
0
Morteza R.g, sure thing, thanks for the offer.
2nd Dec 2023, 3:35 PM
Martin Jimenez
Martin Jimenez - avatar
0
Martin Jimenez yw my bro🌹
2nd Dec 2023, 5:55 PM
Morteza R.g
Morteza R.g - avatar