Нужна в переводе 3-х программ с языка pascal в vba program num2; uses crt; var a : array [1..100] of integer; i,k,n, s : integer; begin clrscr; s: =0; write('k='); readln(k); write('n='); readln(n); for i: =1 to n do readln(a[i]); for i: =1 to n do if (a[i] mod k)=0 then s: =s+a[i]; writeln('s=',s); end. program num1; uses crt; var i, e : integer; begin clrscr; i: =0; write('e='); readln(e); while i begin i: =i+sqrt(2); end; writeln('i=',i); end. program num3; uses crt; var a, t : array [1..100, 1..100] of integer; i, j, x : integer; begin clrscr; for i: =1 to 100 do for j: =1 to 100 do a[i,j]: =random(10); for i: =1 to 100 do for j: =i+1 to 100 do t[i,j]: =a[i,j]; for i: =1 to 100 do for j: =1 to 100 do begin x: =0,5*((a[i,j]^2)+(a[i,j]^t[i,j])); writeln('x[',i,',',j,']=',x); end; end.

daniyabekzhan1 daniyabekzhan1    3   30.07.2019 14:40    0

Ответы
Tiiiddj Tiiiddj  25.08.2020 16:38
Sub num2()
    s = 0
    Dim A
    k = CInt(InputBox("K ="))
    n = CInt(InputBox("N ="))

    ReDim A(n - 1)
    For i = 0 To n - 1
        A(i) = CInt(InputBox("A(" & i & ") ="))
        If A(i) Mod k = 0 Then s = s + A(i)
    Next
    MsgBox s
End Sub

Sub num1()
    i = 0
    e = CDbl(InputBox("E ="))
    Do While i <= e
        i = i + Sqr(2)
    Loop
    MsgBox "i = " & i
End Sub
ПОКАЗАТЬ ОТВЕТЫ
Другие вопросы по теме Информатика