统计多字符出现次数
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Collections;namespaceConsoleApplication3{classProgram{staticvoidMain(string[]args){a();}publicstaticinta(){stringab;stringfull="aaabbbcaaa";HashtablestringTime=newHashtable();for(inti=0;i<full.Length-1;i++){intk=0;ab=full.Substring(i,2);for(intj=0;j<full.Length-1;j++){stringcAb=full.Substring(j,2);if(ab.Equals(cAb)){k++;}}if(!stringTime.ContainsKey(ab)){stringTime.Add(ab,k);}}return0;}}}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。