http://en.wikipedia.org/wiki/H-index
这个维基页面是h-index的定义
基本上如果我有一个[0 3 4 7 8 9 10]的数组,我的h指数将是4,因为我有4个大于4的数字.如果我有5个,我的h指数将是5数字大于5,等等.给定一个大于或等于0的整数数组,有效计算h指数的方法是什么?
编辑:数组不一定排序
我有这个ansible剧本
- name: set var small
set_fact:
iops_price = 41538
ram_price_id = 32438
second_san_price_id = 32926
os_price_id = 49061
when: plan|lower == 'small'
- name: aa
command: echo "{{iops_price}}"
Run Code Online (Sandbox Code Playgroud)
它失败了,因为它说没有定义iops_price,这是输出:
TASK [set var small] ***********************************************************
task path: /home/hanna/proj/db2onc-deploy/db.yml:98
ok: [localhost] => {"ansible_facts": {"_raw_params": "iops_price = 41538 ram_price_id = 32438 second_san_price_id = 32926 os_price_id = 49061"}, "changed": false}
TASK [aa] **********************************************************************
task path: /home/hanna/proj/db2onc-deploy/db.yml:107
fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to …Run Code Online (Sandbox Code Playgroud) if (~mask == 0){...}
Run Code Online (Sandbox Code Playgroud)
我在其中一个.cpp文件中遇到过这个东西,我想知道在c/c ++中是什么意思?