摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows.Forms;namespace ConPra{ class Program { public static void Main(string[] Args) { List<string> names = new List<string>(); names.Add("ganquanfu1"); names.Add("ligang2" 阅读全文
摘要:
usingSystem;usingSystem.Linq;namespaceConTest{classProgram{staticvoidPrint(stringtext,intoffset){ varmatrix=text .Select((c,i)=>new{Char=c,Index=i}) .GroupBy(c=>c.Index%offset,c=>c.Char.ToString()); Array.ForEach( matrix.ToArray(), a=>Console.WriteLine(String.Join("|",a.Reverse 阅读全文
摘要:
//Linq的写法usingSystem;usingSystem.Linq;namespaceConTest{classProgram{staticvoidMain(string[]args){Console.WriteLine("请输入字符串:");stringinput=Console.ReadLine();varresult=fromcininputgroupcbycintogselectg;foreach(vartinresult){Console.WriteLine("{0},{1}",t.Key,t.Count());}Console.Rea 阅读全文