Visual Basic? Их много, вот, например, на VB.NET
Sub Main()
Dim N As UInteger
Dim Num As Integer
Dim A As String = String.Empty
N = Integer.Parse(Console.ReadLine())
For i As UInteger = 1 To N
Console.Write(i.ToString() + " ")
Num = Integer.Parse(Console.ReadLine())
If Num = 0 Then
A += i.ToString()
End If
Next
Console.WriteLine()
Console.WriteLine()
Console.WriteLine(A.Length)
Console.WriteLine()
For Each i As Char In A
Console.WriteLine(i)
Next
Console.ReadKey()
End Sub