using System;
namespace G09 {
class Reverse {
static void Main()
{
Console.WriteLine(ReverseText(24));
Console.ReadKey();
}
static string ReverseText(int n) {
if (n < 1)
{
return "";
}
string index = "1";
string revIndex = "";
int count = 1;
string[] arr = new string[n];
for (int i = 0; i < n; i++)
{
arr[i] = index + revIndex;
for (int j = 0; j <= i; j++)
{
if (count > 8)
{
index = index + 0;
count = 0;
break;
}
index = index + (count++ + 1).ToString();
break;
}
revIndex = "";
for (int k = index.Length - 1; k >= 0; k--)
{
if (k == index.Length - 1)
{
continue;
}
revIndex += index[k];
}
}
return string.Join("\n", arr);
}
}
}
/tmp/csharp117013-18-5s54om.vh6mt2o6r/code.cs(10,41):警告CS0162: 可達代碼檢測爲什麼我會收到錯誤「無法檢測到的代碼」?
誰能告訴我爲什麼這個代碼是無法訪問第23行? 我不明白...在視覺工作室它工作正常,但在其他顯示錯誤。
我們應該猜測第23行嗎? – Idos
Visual Studio 2015更新3 –