Program a; var s: array of integer; x,n,p,sum,max,min,i,k,o,m:integer; begin p:=1; sum:=0; m:=-1; o:=-1; max:=-MaxInt; min:=MaxInt; Write('n= '); read(n); setlength(s,n); Writeln('Перечислите значения:'); for x:=0 to n-1 do begin read (s[x]); k:=s[x]; if (k>0) and ((k mod 5) =0) then sum:=sum+k; if ((k mod 10)=0) and (k>max) then begin max:=k; o:=x; end; if ((k mod 2) = 0) and (k<min) then begin min:=k; m:=x; end; end;Writeln('Сумма = ',sum); if (ABS(o-m)=1) or (o=m) or (o=-1) or (m=-1) then write('Диапазон не найден') else begin if (o>m) then for i:=m+1 to o-1 do p:=s[i]*p else for i:=o+1 to m-1 do p:=s[i]*p; writeln('Произведение = ',p); end; end.
dim years years = inputbox("Введите ваш возраст") if years = 1 then msgbox("Мне 1 год") end if if years = 2 then msgbox("Мне 2 годa") end if if years = 3 then msgbox("Мне 3 годa") end if if years = 4 then msgbox("Мне 4 годa") end if if (years >= 5) and (years <= 19) then msgbox("Мне "+cstr(years)+" лет") end if
if years >= 20 then dim s s = "Мне "+cstr(years) if (years mod 10 = 1) then s = s + " год" end if if (years mod 10 >= 2) and (years mod 10 <= 4) then s = s + " годa" end if if (years mod 10 >= 5) and (years mod 10 <= 9) then s = s + " лет" end if if (years mod 10 = 0) then s = s + " лет" end if msgbox(s) end if
VBS
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку