//程式碼如下,大概就是定義一個和讀出的字串一樣大小的臨時字元陣列
using System;
using System.Collections.Generic;
using System.Text;
namespace Change
{
class Program
static void Main(string[] args)
while (true)
string Str = Console.ReadLine();
char[] CharArr= Str.ToCharArray();
if (CharArr.Length != 0)
string TempStr = "";
for (int i = CharArr.Length; i > 0; i--)
TempStr += CharArr[i - 1].ToString();
}
Console.Write( "反向結果:"+ TempStr + "\n");
//程式碼如下,大概就是定義一個和讀出的字串一樣大小的臨時字元陣列
using System;
using System.Collections.Generic;
using System.Text;
namespace Change
{
class Program
{
static void Main(string[] args)
{
while (true)
{
string Str = Console.ReadLine();
char[] CharArr= Str.ToCharArray();
if (CharArr.Length != 0)
{
string TempStr = "";
for (int i = CharArr.Length; i > 0; i--)
{
TempStr += CharArr[i - 1].ToString();
}
Console.Write( "反向結果:"+ TempStr + "\n");
}
}
}
}
}