+ 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
10 odpowiedzi
+ 4
Yes, refer to this link :
https://code.sololearn.com/c78mL4zCyVZ6/?ref=app
+ 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();
+ 2
Thank you, I am modifying the code.
+ 2
I did it bit complicatedly.
https://code.sololearn.com/cQkKDtZAi1FR/?ref=app
+ 2
ACE,
I'm a little simpler)
https://code.sololearn.com/c81FyGzHDvaO
+ 1
AnonymouS This is very Perfect, Good Luck🌷
+ 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);
}
0
Martin Jimenez I wrote this program with the help of one of my friends, if you like I can send it to you.🙏🌹
0
Morteza R.g, sure thing, thanks for the offer.
0
Martin Jimenez yw my bro🌹