統計字元頻率

2021-07-28 10:57:59 字數 425 閱讀 6020

輸入資料有多組,每組佔一行,由乙個n為的整數構成(ytq急著打**,沒有告訴你n是多少,只告訴這個數字小於10的1000次方)。

對於每組輸入資料,輸出一行,對應乙個要求的答案(答案為0~9之間的乙個數字,如果有過個

數字出現次數一樣多的情況,輸出最小的數字)

1234567891

11122333

1235564

1

15

#include#include#includeusing namespace std;

struct ij;

//比較函式 若x相同則下標小的排在前面,否則x大的在前面

bool cmp(ij a,ij b)

char s[1005];

int main()

for(i=0;i

C 讀取檔案字元,統計字元頻率

統計檔案中子母出現的頻數 include include includeusing namespace std 鍊錶節點定義 typedef struct lnode link 建立乙個新結點 link createnode void return newnode int main out stre...

Frequency 頻率統計

coding utf 8 created on fri oct 20 19 16 41 2017 author esri import nltk from nltk import freqdist 做個詞庫先 corpus this is my sentence this is my life th...

NLP 統計頻率

引入必要的包 import re from collections import counter方法一 version one defget max value v1 text 統一為小寫字母 text text.lower 返回所有的字母 result re.findall a za z text...