Var r:array[1..3,1..3] of integer;i,j,n,k,sum:integer; b:array[1..30]of integer;beginrandomize;writeln('Исходная матрица: ');for i:=1 to 3 dobeginfor j:=1 to 3 dobeginr[i,j]:=random(15)-5;write(r[i,j]:3);end;writeln;end;// cумма диагоналиwriteln;for i:=1 to 3 dobeginfor j:=1 to 3 dobeginif i=j then beginwrite(r[i,j]:3);sum:= sum + r[i,j];end elsewrite(' ':3);end;writeln;end;writeln(sum);end.
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