1-ая Program one; Var n, i : integer; a : array [1..1010] of integer; Begin read(n);
for i := 1 to n do begin read(a[i]); end; for i := 1 to n do begin write(a[i], ' '); end; writeln(); for i := n downto 1 do begin write(a[i], ' '); end; End. 2-ая Program two; Var n, i, k: integer; a : array [1..1010] of integer; Begin read(n); k := 1; while (n > 0) do begin a[k] := n mod 10; k := k + 1; n := n div 10; end; for i := k - 1 downto 1 do write (a[i], ' '); End. 3-я Program two; Var k, start, endd, i: integer; a : array [1..1010] of integer; Begin read (start, endd); k := 1; for i := start to endd do begin if (i mod 2 = 0) then begin a[k] := i; k := k + 1; end; end;
Program one;
Var
n, i : integer;
a : array [1..1010] of integer;
Begin
read(n);
for i := 1 to n do
begin
read(a[i]);
end;
for i := 1 to n do
begin
write(a[i], ' ');
end;
writeln();
for i := n downto 1 do
begin
write(a[i], ' ');
end;
End.
2-ая
Program two;
Var
n, i, k: integer;
a : array [1..1010] of integer;
Begin
read(n);
k := 1;
while (n > 0) do
begin
a[k] := n mod 10;
k := k + 1;
n := n div 10;
end;
for i := k - 1 downto 1 do
write (a[i], ' ');
End.
3-я
Program two;
Var
k, start, endd, i: integer;
a : array [1..1010] of integer;
Begin
read (start, endd);
k := 1;
for i := start to endd do
begin
if (i mod 2 = 0) then
begin
a[k] := i;
k := k + 1;
end;
end;
for i := k - 1 downto 1 do
write (a[i], ' ');
End.
using System;
namespace znanja
{
class Program
{
static void Main(string[] args)
{
int num = int.Parse(Console.ReadLine());
int[] array = new int[num];
array = Array.ConvertAll(Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries), int.Parse);
int count = 0;
for (int i = 0; i < num; i++)
{
if (array[i] > 0) count++;
}
Console.WriteLine(count);
}
}
}