有什么统计软件!可以计算出数字出现的英语单词使用频率统计和差距!

查看: 3759|回复: 4
如何统计一列中,某个数字连续出现的次数
阅读权限10
在线时间 小时
本帖最后由 dengjq2000 于
21:18 编辑
比如A列中,有0,或者有1这两个数字,怎么能统计A这一列中,连续是1的数字的出现的次数最多是的几次?比如说这个图片上排列的是0,0,0,1,1,1,0,0,1,1这样,就是怎么能统计出1这个数字,最多连续出现的次数是连续出现了几次?
1.jpg (30.12 KB, 下载次数: 1)
13:16 上传
阅读权限30
在线时间 小时
假设数据在A列
=MAX(FREQUENCY(IF(A1:A9=1,ROW(A1:A9)),IF(A1:A9&&1,ROW(A1:A9))))
ctrl+shift+enter三键结束输入公式
阅读权限10
在线时间 小时
hyww7453 发表于
假设数据在A列
=MAX(FREQUENCY(IF(A1:A9=1,ROW(A1:A9)),IF(A1:A91,ROW(A1:A9))))
是乱码,是我弄错了吗?
在请教下,一共是65536行 是在I列
是不是公式就是
=MAX(FREQUENCY(IF(i1:i65536=1,ROW(i1:i65536)),IF(i1:i65536&&1,ROW(i1:655369))))
阅读权限10
在线时间 小时
=MAX(FREQUENCY(IF(i1:i65536=1,ROW(i1:i65536)),IF(i1:i65536&&1,ROW(i1:I65536))))
是这个公式吗
阅读权限30
在线时间 小时
chenpenglin 发表于
=MAX(FREQUENCY(IF(i1:i65536=1,ROW(i1:i65536)),IF(i1:i655361,ROW(i1:I65536))))
是这个公式吗
是这个公式
这个是数组公式
输入公式最后要按三个键:ctrl+shift+enter&&这样就不会出现错误了
玩命加载中,请稍候
玩命加载中,请稍候
Powered by
本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任! & & 本站特聘法律顾问:徐怀玉律师 李志群律师您的举报已经提交成功,我们将尽快处理,谢谢!
若这几列姓名是在A1:J1000,侧方法:
选中A列到J列→格式→条件格式→公式→=COUNTIF($A$1:$J$→格式→字体→颜色(选...
大家还关注
(window.slotbydup=window.slotbydup || []).push({
id: '2081942',
container: s,
size: '1000,60',
display: 'inlay-fix'查看:7940|回复:7
假如输入一组数字,怎么来统计这些输入的数字中,哪个数字输入的次数最多呢?用vector来解决最好,自己写代码的时候用到了标准库函数sort(),但是还是没能写出来。
中级工程师
利用map可以解决问题复制内容到剪贴板代码:#include&iostream&
#include&map&
int main(int argc, char **argv){
&&map&int, int& numC
&&int i = 0;
&&while(cin&&i){
& & if(numCount.find(i) == numCount.end())
& && &numCount.insert(std::make_pair&int, int&(i, 1));
& && &++numCount[i];
&&map&int, int&::const_iterator cit = numCount.begin();
&&int targetNum = cit-&
&&int mostFrequency = cit-&
&&for(++ cit!=numCount.end(); ++cit){
& & if(cit-&second & mostFrequency){
& && &targetNum = cit-&
& && &mostFrequency = cit-&
&&cout&&&出现频率最多的数是: &&&targetNum&&endl
& & &&&出现次数: &&&mostFrequency&&
&&return EXIT_SUCCESS;
}引用:原帖由 chicqq 于
15:11 发表
假如输入一组数字,怎么来统计这些输入的数字中,哪个数字输入的次数最多呢?用vector来解决最好,自己写代码的时候用到了标准库函数sort(),但是还是没能写出来。 ...
The best of man is like water
Which benefits all things, and does not contend with them
Which flows in places that others disdain
Where it is in harmony with the Way
。。。。。。。。。。。。。我也用的map,吧自己的也贴上吧复制内容到剪贴板代码:#include&iostream&
#include&map&
int main()
& & & & map&int,int&
& & & & while(cin&&a)
& & & & & & & & ++str[a];
& & & & int value=(str.begin())-&
& & & & int Max=(str.begin())-&
& & & & for(map&int,int&::iterator iter=str.begin();iter!=str.end();iter++)
& & & & & & & & if(iter-&second&Max)
& & & & & & & & {
& & & & & & & & & & & & value=iter-&
& & & & & & & & & & & & Max=iter-&
& & & & & & & & }
& & & & cout&&value&&&:&&&Max&&
& & & & return 0;
只有你爬到山顶了,这座山才会支撑着你。
中级工程师
嗯,我尽然还自以为是的去做了一个存在判断,学习了引用:【map operator [ ]】
If x matches the key of an element in the container, the function returns a reference to its mapped value.
If x does not match the key of any element in the container, the function inserts a new element with that key and returns a reference to its mapped value. Notice that this always increases the map size by one, even if no mapped value is assigned to the element (the element is constructed using its default constructor).复制内容到剪贴板代码:#include&iostream&
#include&map&
int main(int argc, char **argv){
&&map&int, int& numC
&&int i = 0;
&&while(cin&&i)
& & ++numCount[i];
&&map&int, int&::const_iterator cit = numCount.begin();
&&int targetNum = cit-&
&&int mostFrequency = cit-&
&&for(++ cit!=numCount.end(); ++cit){
& & if(cit-&second & mostFrequency){
& && &targetNum = cit-&
& && &mostFrequency = cit-&
&&cout&&&出现频率最多的数是: &&&targetNum&&endl
& & &&&出现次数: &&&mostFrequency&&
&&return EXIT_SUCCESS;
}引用:原帖由 月夜幻影 于
17:50 发表
。。。。。。。。。。。。。我也用的map,吧自己的也贴上吧
int main()
& && &&&while(cin&&a)
& && && && && & ++str[a];
& && &&&int value=(str.begin())-&
& && &&&int Max= ...
The best of man is like water
Which benefits all things, and does not contend with them
Which flows in places that others disdain
Where it is in harmony with the Way
vector复制内容到剪贴板代码:#include&iostream&
#include&vector&
#include&algorithm&
int main()
& & & & vector&int&
& & & & while(cin&&a)
& & & & & & & & str.push_back(a);
& & & & sort(str.begin(),str.end());
& & & & int value=str[0];
& & & & int Max=0;
& & & & int num=1;
& & & & int prev=str[0];
& & & & for(int i=1;i&str.size();i++)
& & & & & & & & curr=str[i];
& & & & & & & & if(curr==prev)
& & & & & & & & {
& & & & & & & & & & & & num++;
& & & & & & & & }
& & & & & & & & else
& & & & & & & & {
& & & & & & & & & & & & if(num&Max)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & Max=
& & & & & & & & & & & & & & & & value=
& & & & & & & & & & & & }
& & & & & & & & & & & & num=1;
& & & & & & & & & & & & prev=
& & & & & & & & }
& & & & cout&&value&&&:&&&Max&&
& & & & return 0;
只有你爬到山顶了,这座山才会支撑着你。
但是我还没有学到map函数那呢,呵呵。
没用过map之前我的做法是直接排序后,统计相等的最长的连续子序列。
用过map之后就不说了,红黑树。
嗯,简明达意查看: 6118|回复: 5
如何统计某个区间段数字出现的次数
阅读权限20
在线时间 小时
谢谢高手指点下啦
10:15 上传
点击文件名下载附件
1.99 KB, 下载次数: 58
阅读权限100
在线时间 小时
(3.65 KB, 下载次数: 83)
10:22 上传
点击文件名下载附件
阅读权限70
在线时间 小时
选中E2:E4,输入下面公式,CTRL+SHIFT+ENTER=FREQUENCY($B$2:$B$13,{30,40,150})复制代码
阅读权限20
在线时间 小时
恩,好的,今天学习下FREQUENCY这个函数
阅读权限95
在线时间 小时
(7.48 KB, 下载次数: 63)
10:38 上传
点击文件名下载附件
阅读权限50
在线时间 小时
看看这个行不
(127.19 KB, 下载次数: 50)
10:52 上传
玩命加载中,请稍候
玩命加载中,请稍候
Powered by
本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任! & & 本站特聘法律顾问:徐怀玉律师 李志群律师

我要回帖

更多关于 c语言统计单词频率 的文章

 

随机推荐