const n=40; var a:array [1..n] of integer; i,k:integer; begin Randomize; k:=0; Writeln('Исходный массив'); for i:=1 to n do begin a[i]:=random(63)+20; Write(a[i],' ') end; Writeln; Writeln('Четные элементы, кратные 3'); for i:=1 to n do if a[i] mod 6=0 then begin Inc(k); Write(a[i],' ') end; Writeln; Writeln('Отобрано элементов: ',k) end.
const n=20; var a:array [1..n] of integer; i,imin:integer; begin Randomize; Writeln('Исходный массив'); imin:=1; for i:=1 to n do begin a[i]:=random(351)+20; Write(a[i],' '); if a[i]<a[imin] then imin:=i end; Writeln; Writeln('Минимальный элемент a[',imin,']=',a[imin]) end.
#include <iostream> using namespace std; int main() { setlocale(0,""); int a; cout<<"введите значение погоды"<<endl; cout<<"1-тепло"<<endl; cout<<"2-жарко"<<endl; cout<<"3-холодно"<<endl; cout<<"4-колотун"<<endl; cin>>a; switch (a) { case 1: cout<<"вы можете одеть джинсы и футболку"<<endl; break; case 2: cout<<"вы можете одеть шорты и майку "<<endl; break; case 3: cout<<"вы можете одеть штаны и толстовку "<<endl; break; case 4: cout<<"вы можете одеть куртку и свитер с подштанниками и ватными штанми "<<endl; break; } return 0; }
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку