热门问题
时间线
聊天
视角
Iota函数
来自维基百科,自由的百科全书
Remove ads
此条目没有列出任何参考或来源。 (2017年5月4日) |
提供该函数的语言
写作,产生从1到N的连续整数,即 1、2、3、……、N。
自C++11起提供,位于<numeric>库。
#include <iostream>
#include <vector>
#include <numeric>
std::vector<char> vch(26);
std::iota(vch.begin(), vch.end(), 'a');
for(char ch: vch){
std::cout<<ch;//abcdefghijklmnopqrstuvwxyz
}
在 System.Linq.Enumerable(以及ParallelEnumerable)中。
Dim vi As New List(Of Integer)(System.Linq.Enumerable.Range(5, 6))
For Each i As Integer In vi
System.Diagnostics.Debug.WriteLine(i)'5 6 7 8 9 10
Next i
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads