文章标题
来源:互联网 发布:游戏测试面试题算法 编辑:程序博客网 时间:2024/06/05 04:54
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StringSort
{
class Program
{
static void Main(string[] args)
{
StringSortAndNum(“ajhsdZzfjhAZKJSDK”);
Console.ReadKey();
}
static void StringSortAndNum(String str) { String s1 = ""; for (int i = 65; i <91; i++) { foreach (char item in str) { if ((int)item == i) { s1 += item; } } foreach (char item in str) { if ((int)item == i+('a'-'A')) { s1 += item; } } } Dictionary<char, int> strAndNum = new Dictionary<char, int>(); foreach (char item in s1) { if (strAndNum.ContainsKey(item)) { strAndNum[item]++; } else { strAndNum.Add(item,1); } } Console.Write("排序后:"); Console.WriteLine(s1); foreach (var item in strAndNum) { Console.WriteLine("{0}出现次数:{1}",item.Key,item.Value); } }}
0 0
- 文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题 文章标题 文章标题 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 腾讯2017暑假笔试题-查找二叉树的根
- 监控
- WAMP安装配置过程笔记
- Spring参数注入的几种方法
- FaceNet: A Unified Embedding for Face Recognition and Clustering
- 文章标题
- C++
- 插件式换肤框架搭建
- eclipse两种方式解决添加未实现的方法(Add unimplemented methods)
- 深入理解JVM 一GC(下) G1 Garbage Collector
- 系统调用、POSIX、C库、系统命令和内核函数
- Android Bitmap知识梳理学习
- Linux文件操作
- golang九九乘法表,哈哈。