Arrays 在数组中显示偶数

Arrays 在数组中显示偶数,arrays,pseudocode,Arrays,Pseudocode,我需要在一个数组中显示偶数(在伪代码中),我完全不知道如何做到这一点 就我所知: Begin write_evens(in numbers As Array of Integers, in array_size As Integer) Declare count As Integer Set count ← 0 While count < size *******I'm stuck on what to do in the loop***** Set count ← cou

我需要在一个数组中显示偶数(在伪代码中),我完全不知道如何做到这一点

就我所知:

Begin write_evens(in numbers As Array of Integers, in array_size As Integer)
    Declare count As Integer
    Set count ← 0
While count < size
*******I'm stuck on what to do in the loop*****
Set count ← count + 1
Begin write_evens(以数字表示整数数组,以数组大小表示整数)
将计数声明为整数
计数← 0
而计数<大小
*******我被困在循环中该做什么*****
计数← 计数+1
{编辑}

我就在这里:

Begin write_evens(in numbers As Array of Integers, in array_size As Integer)
    Declare count As Integer
    Set count ← 0
    While count < size
    If array_size % 2 == 0 
    Write array_Size
End if
    Set count ← count + 1
End
Begin write_evens(以数字表示整数数组,以数组大小表示整数)
将计数声明为整数
计数← 0
而计数<大小
如果数组大小%2==0
写入数组大小
如果结束
计数← 计数+1
终点

使用模来测试数字是否为偶数。比如:print这里有一些伪代码,可以根据需要执行。如果您需要任何澄清,请告诉我

function write_evens(A array of integers)
    int i = 0;
    while i < A.length
        if (i%2 == 0)
           print A[i] + " "
        i++
函数写入(整数数组)
int i=0;
而我
您应该在循环中编写的伪代码是
如果是偶数(count),则打印(count)
。我将我的原始问题更新为目前为止的问题。