+ 4
Hi I need help NO NUMBER (Solution)
5 odpowiedzi
+ 11
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static List<string> numbers = new List<string>() { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
static void Main(string[] args)
{
string str = Console.ReadLine();
for (int i = 0; i < str.Length; i++)
{
for (int k = 0; k < numbers.Count; k++)
{
if (str[i] == Convert.ToChar(Convert.ToString(k)))
{
str = str.Replace(Convert.ToString(str[i]), numbers[k]);
}
}
}
str = str.Replace("onezero","ten");
Console.Write(str);
}
}
}
+ 12
Show your attempt first
+ 3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
string[] words = Console.ReadLine().Split();
int[] f = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
string[] word = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" };
foreach (string str in words)
Console.Write(Regex.IsMatch(str, @"\d") ?
word[Convert.ToInt32(str)] + " " : str + " ");
}
}
}
(C)
+ 3
which is also not true
+ 2
Ok