1) файл паскаля приложен. 2) код на c# static void Main(string[] args) { int a, b; a = Convert.ToInt32(Console.ReadLine()); b = Convert.ToInt32(Console.ReadLine()); if (a > 2) { Console.WriteLine(a / 2); Console.WriteLine(b - 1); } } 3) Код на vb dim a as integer = 0 dim b as integer = 0 a = cint(console.readline()) b = cint(console.readline()) if a > 2 then console.writeline( a / 2) console.writeline(b - 1) end if
{$APPTYPE CONSOLE} Type Mass = array of array of integer; Procedure KP(Var A:Mass; N:integer); Var i,j,k:integer; Begin k:=0; For j:= 0 to N-1 do if j mod 2 = 0 then For i:= 0 to N-1 do if A[i,j] > 0 then k:=k+1; WriteLn('k = ',k) End;
Procedure RND(Var A:Mass; N:integer); Var i,j:integer; Begin Randomize; SetLength(A,N,N); For i:= 0 to N-1 do Begin For j:= 0 to N-1 do Begin A[i,j]:=random(21)-10; Write(A[i,j]:3,' ') End; WriteLn End; End; Var A,B:Mass; N,M:integer; Begin Write('N = ');ReadLn(N); WriteLn('A(',N,',',N,'):'); RND(A,N); KP(A,N); Write('M = ');ReadLn(M); WriteLn('B(',M,',',M,'):'); RND(B,M); KP(B,M); ReadLn End.
2) код на c#
static void Main(string[] args) { int a, b; a = Convert.ToInt32(Console.ReadLine()); b = Convert.ToInt32(Console.ReadLine()); if (a > 2) { Console.WriteLine(a / 2); Console.WriteLine(b - 1); } }
3) Код на vb
dim a as integer = 0
dim b as integer = 0
a = cint(console.readline())
b = cint(console.readline())
if a > 2 then
console.writeline( a / 2)
console.writeline(b - 1)
end if