怎么讲接收用户输入的字符串,逆序输出呢?

80后大叔爱学习
大数据领域优质创作者
博客专家认证
2009-04-02 11:17:00
怎么讲接收用户输入的字符串,逆序输出呢?,在线等
...全文
456 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
mengsijun1987 2009-04-03
  • 打赏
  • 举报
回复
Array.Reverse()

同意
wp19861223 2009-04-02
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 Guyschaos 的回复:]
Array.Reverse()
[/Quote]

同意
lgqiu2008 2009-04-02
  • 打赏
  • 举报
回复
6楼的快
贫僧又回来了 2009-04-02
  • 打赏
  • 举报
回复
Array.Reverse()
youyouke 2009-04-02
  • 打赏
  • 举报
回复
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
string re = Console.ReadLine();
for (int i = 0; i < re.Length; i++)
{
Console.Write(re[re.Length - i-1]);
}
Console.ReadLine();
}
}
}
WizardWu 2009-04-02
  • 打赏
  • 举报
回复
Stack 类
表示对象的简单的后进先出非泛型集合。
命名空间: System.Collections
http://msdn.microsoft.com/zh-cn/library/system.collections.stack(VS.80).aspx
http://msdn.microsoft.com/zh-cn/library/system.collections.stack_members(VS.80).aspx

Stack myStack = new Stack();
myStack.Push("Hello");
myStack.Push("World");
myStack.Push("!");

/*
This code produces the following output.
myStack
Count: 3
Values: ! World Hello
*/
xufzu123 2009-04-02
  • 打赏
  • 举报
回复
public void JudgeCommand()
{
string str = "123";
StringBuilder a = new StringBuilder();
for(int i=str.Length-1;i>=0;i--)
{
a.Append(str[i]);
}

MessageBox.Show(a.ToString());
}
xueyonglyn 2009-04-02
  • 打赏
  • 举报
回复
Console.WriteLine("请输入内容");
string read = Console.ReadLine().ToString();
for (int i = read.Length - 1; i > -1; i--)
{
Console.Write(read[i]);
}
Mr-Jee 2009-04-02
  • 打赏
  • 举报
回复
private static string bb(string a)
{
string b = string.Empty;
for (int i = 0; i < a.Length; i++)
{
b += a.Substring(a.Length - i - 1, 1);
}
return b;
}
zou_bk 2009-04-02
  • 打赏
  • 举报
回复
Array.Reverse()
jwdream2008 2009-04-02
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 Guyschaos 的回复:]
Array.Reverse()
[/Quote]
很好啊!
深海之蓝 2009-04-02
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 Guyschaos 的回复:]
Array.Reverse()
[/Quote]
正解

110,567

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧