# 定义字符串 s = "Toc{CnCTeCTFf{mF{oFC0?tCnutTtFffyfiT0{C{mi0it00ifFeftcfcCto{o{nnnCTf}nui0Cm?FmCn{FmCT?{yfn?if0fiifumfunfT6!cCeCyTycmmFTo???e{m!ion{tCitT!{nc{Foi?C{f!e?iTt?}Ce0iyem{CTui?CtyCF{?Fyfn{m0!eoCFi?{in}niFfoc?F?0to{?iT?!n{cCfttFmy{F0CTCielT}fTnnmCfncCeyF?{mneFm{TemnT{ufT{fFTf}iF0coCn{{0?ycu?o{f?FcC?0uymoFmT0}0e{tTeof{e!oFctCennTym}F?0oeciCo}omni{if!cd}gieFufTmFneCct{TneCCyfFCyct?f{CTmcn{{FCuCCmFfcToC{u0TFcC?myCfnF0t{ifF?cTc0{}FFfT{mF!?FmoFCFyuToc5icoenn!uT?FoeTT{n{ify?ffniF{fTei?0tT0fqui?u2min!?kFFCtnttnie{?CfCF0rieuTiTT{Cntfeocfotm0mT?efeu0F?Te?}{nn?cFF?ycucinuFCfuTTo{CTCyfF03i!Fcitf{{nutt?mT?Tye{Ct{icmFFTC?tTn}Cc0ic{n?ntyffif?eFmniiFtCTm?tT?T{nyeoicT!ytFTiF0!ye??yffnFn{fTTttTTnfenoyFfTuCoiFcoF?cTTc?ucc{yT?{n?eCFyceC?c!mTmT?fConyyotC?eCiCFni{cccaiFCFC!F0ucitFetCcfccy{FjeTf{TCFyCp?FieFTefnFtf0?yT!eo0nCic!{if?F9}FCoomehiffcc?{{{tF?CmuFo!}feeyFiT{n?iyFiuTi0u{{C{CCTcFoccF?0fmf?wufoiytfn!iiCTmc?f?oen?mFCtcTF{z0fu?CFc!{e}CfeeTnitv}ft0nFT?Ft1imn!Cn}mcT?ocnoc?FuCc7nfF{T?ofnxCi{f{CCteTmoFoCF?e?FTC?C!}fiyte{nF?{FenCFct!08ytfufC{{0FeefsiiTotin}CnynCnui0ofCfct?tfCyCFbofcCfuifC?fio!tt?{{{Fi{TCe0cfneT{cmef4FTomTenuttTFCyTCCTenFonoTnT}uF?TFFu?enm"
# 创建字典 freq = {}
# 遍历字符串,计算字符频次 for char in s: if char in freq: freq[char] += 1 else: freq[char] = 1
result = sorted(freq.items(), key=lambda x: x[1], reverse=True) for char, count in result: print(char, count)