Procedure maxminsum(a,b,c: real); var sum,max,min: real; begin if (a> b) and (a> c) then max: =a; if (b> a) and (b> c) then max: =b; if (c> b) and (c> a) then max: =c; if (a< b) and (a< c) then min: =a; if (b< a) and (b< c) then min: =b; if (c< b) and (c< a) then min: =c; sum: =a+b+c; writeln('max = ',max); writeln('min = ',min); writeln('sum = ',sum); end; var a,b,c: real; begin readln(a,b,c); maxminsum(a,b,c); end.
Alekseevich_Elena
22.04.2020
Язык vba: function bin(s as string, z as integer) as string dim c as integer dim oct as integer c = val(s) do oc = c mod 2 c = c \ 2 bin = bin & str(oc) loop until c = 0 bin = strreverse(bin) if z = -1 then bin = "-" & bin end function sub z() dim s as string, s1 as string dim n as integer, i as integer, z as integer dim max s = inputbox("введите строку: ") max = null i = 1 do while i < = len(s) select case mid(s, i, 1) case 0 to 9 if z = 0 and i > 1 then z = iif(mid(s, i - 1, 1) = "-", -1, 1) else: z = 1 end if s1 = s1 + mid(s, i, 1) if i = len(s) then gosub 1 case else: if s1 < > "" then gosub 1 end select i = i + 1 loop msgbox ("max=" & max) end 1: n = z * val(s1) msgbox (n & "; двоичная форма: " & bin(s1, z)) if isnull(max) then max = n if max < n then max = n z = 0 s1 = "" return end sub
Дил1779
22.04.2020
1)const nmax=50; mmax=50; var x: array [1..nmax, 1..mmax] of integer; n,m,i,j,ki: integer; begin write('введите размерность матрицы: '); readln(n,m); writeln('введите элементы матрицы: '); for i: =1 to n do for j: =1 to m do readln(x[i,j]); writeln('матрица: '); for i: =1 to n do begin for j: =1 to m do write(x[i,j]); writeln(' '); end; j: =1; while (j< =m) do begin ki: =0; for i: =1 to n do if (x[i,j] mod 2 =0) then ki: =ki+1; writeln('в столбце',j,': ',ki,' чётных элементов'); j: =j+2; end; end.2)for i: =1 to 5 do begin for j: =1 to 5 do begin if (j mod 2=0) and (a[i,j]> 0) then s: =s+a[i]; 3)int[,] mass = new int[5,6]; for(int i=0; i< 5; i++) { for(int j=0; j< 6; j++) mass[i,j]=convert.toint32(console.; } int [] mass2 =new int[6]; int c=0; for(int i=0; i< 6; i++) { mass2[c]=1; for(int j=0; j< 5; j++) {if(mass[j,i]%2==0& & mass[i,j]> 0) mass2[c]*=mass[j,i]} c++; } for(int i=0; i< 6; i++) { console.writeline(mass2[i]); } console.readline();
Ответить на вопрос
Поделитесь своими знаниями, ответьте на вопрос:
Сделать процедуру максимума и минимума 3 чисел , и их сумму . в паскале