社区
C#
帖子详情
一个非常基础的问题,望高手指点!
dongabox
2005-10-15 04:47:07
用C#写一个程序,非常简单,可是我没有做出来,在这里请求各位大侠帮忙。
先输入一个15个字符的字符串,再将各个字符降序输出来,这个字符串可以是,数字,字母,汉字,等任意字符的组合。
...全文
48
3
打赏
收藏
一个非常基础的问题,望高手指点!
用C#写一个程序,非常简单,可是我没有做出来,在这里请求各位大侠帮忙。 先输入一个15个字符的字符串,再将各个字符降序输出来,这个字符串可以是,数字,字母,汉字,等任意字符的组合。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
yezie
2005-10-15
打赏
举报
回复
char[] c = "asdfeerolsfeerew".ToCharArray();
Array.Sort(c);
机器人
2005-10-15
打赏
举报
回复
static void Main(string[] args)
{
string s = "asdfeerolsfeerew";
Console.WriteLine(s);
char[] c = s.ToCharArray();
Array.Sort(c);
s = new string(c);
Console.WriteLine(s);
Console.ReadLine();
}
SqlDataAdapter
2005-10-15
打赏
举报
回复
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication1
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(96, 168);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "排序";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(64, 32);
this.textBox1.MaxLength = 15;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(200, 21);
this.textBox1.TabIndex = 3;
this.textBox1.Text = "textBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
private void button1_Click(object sender, System.EventArgs e)
{
ArrayList arr =new ArrayList();
foreach(char c in this.textBox1.Text)
{
arr.Add(c);
}
arr.Sort();
this.textBox1.Text ="";
foreach(char c in arr)
{
this.textBox1.Text+=c.ToString();
}
}
}
}
初生婴儿登记表
包含了三个方面技术的应用:Collection、ini文件、Print。适合有一定VB
基础
的朋友,初学的朋友如果看不懂请查相关书集。如有不足,还望
高手
指点
。
总结一下我所掌握的虚函数和多态 (望
高手
指点
!)
C++也学了一段时间了,C++比较让人混乱的除了复杂的标准库和算法....我假设现在的你已经了解C++基于对象的部分,也就是你会写
一个
类,明白类所产生的对象中包含的是他的数据成员(无虚函数的时候).而类的成员
企业实战持续集成-Jenkins视频教程(必备技能)
Linux零
基础
、初学者、中级运维、高级运维,让你轻松突破高薪20K+,通过本套实战课程的全程学习,能力跨越
一个
台阶,选择和努力决定薪资,向高级运维工程师迈进。通过本课程的学习,大家可以从懵懂到熟悉,从熟悉到...
python numpy库是第三方库吗_第一次参加比赛,望
高手
指点
,numpy属于第三方库吗...
望
高手
指点
,numpy属于第三方库吗2815人浏览收藏(0)6个已发布回答投票顺序时间顺序2018-03-30 16:34不属于第三方数据库1收藏(0)2018-10-11 09:37Numpy是
一个
开源的Python科学计算库,它是python科学计算库的
基础
库。...
java 自定义数据结构_java自定义数据结构碰到了
问题
,望
高手
指点
在Java中的数据结构主要包括以下几种接口和类:1、枚举(Enumeration)枚举(Enumeration)接口虽然它本身不属于数据结构,但它在其他数据结构的范畴里...该类在处理一组布尔值的时候非常有用,你只需要给每个值赋值一"位...
C#
110,539
社区成员
642,577
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章