This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable,
visit the help center。
已关闭8年。
我真的不知道发生了什么。第一次成功,然后当我第二次尝试失败
我已经检查了拼写,什么也没找到。我在没有帮助的情况下迷路了
我用
//comment
指出了错误行:)
以防万一我的代码不言自明,我想使用
[1]
选择器获取第二个数字
我的代码是: static void Main(string[] args)
{
españolizar("55","44");
}
static void españolizar(string str, string str2)
{
string[] list1={"cero","un","dos","tres","cuatro","cinco","seis","siete","ocho","nueve","diez","once","doce","trece","catorce","quince"};
string[] list2={"nivelarindexes","dieci","veinti","trei","cuare","cincue","sese","sete","oche","nove"};
int numero = int.Parse(str);
string strNumero = Convert.ToString(numero);
int primerDigito = int.Parse(Convert.ToString(strNumero[0]));
int segundoDigito = 0;
if (strNumero.Length > 1)
//this is the one that fails
segundoDigito = int.Parse(Convert.ToString(strNumero[1]));
//\-------------------------/
}
Console.WriteLine(strNumero);
Console.ReadLine();
}