Iota函数 目录 提供该函数的语言 导航菜单


程序设计语言


计算机语言函数APL 语言C++11




iota 函数是一个计算机语言中的函数,用于产生连续的值。


该函数得名自 APL 语言,其中用来产生从 1 开始的连续数值。




目录






  • 1 提供该函数的语言


    • 1.1 APL


    • 1.2 C++


    • 1.3 .NET Framework







提供该函数的语言



APL


写作ιN{displaystyle iota N},产生从 1 到 N 的连续整数,即 1、2、3、……、N。



C++


自 C++11 起提供,位于 <numerics> 中。


#include <iostream>
#include <vector>
#include <numerics>

std::vector<char> vch(26);
std::iota(vch.begin(), vch.end(), 'a');
for(char ch: vch){
std::cout<<ch;//abcdefghijklmnopqrstuvwxyz
}


.NET Framework


在 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







Popular posts from this blog

“%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

夢乃愛華...