倒序输出字符串

class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一段字符串");
            string str = Console.ReadLine();//获取到控制台输入的字符串
            for (int i = str.Length-1; i >=0; i--)
            {
                Console.Write(str[i]);
            }


            Console.ReadLine();
        }
    }

 

posted @ 2016-08-09 20:23  云晴  阅读(178)  评论(0编辑  收藏  举报