Получить шестнадцатеричную форму внутреннего представления числа в формате с плавающей точкой в 4-х байтовой ячейке восстановить само число. (26.28125)
Var ar:array[1..n] of integer; ar2:array[1..n] of integer; i,k:integer;
function prost(a:integer):boolean; var i:integer; b:boolean; begin b:=true; for i:=2 to a div 2 do if a mod i=0 then begin; b:=false; break; end; if a=1 then b:=false; prost:=b; end;
begin; randomize; k:=0; for i:=1 to n do begin; ar[i]:=random(101); write(ar[i]:4); end; writeln; for i:=1 to n do if prost(ar[i]) then begin; inc(k); ar2[k]:=ar[i]; write(ar2[k]:4); end; end.
Начнем с формул. Площадь треугольника: S = 1/2*a*b*sin C Отсюда: sin C = 2*S/(a*b); cos C = sqrt(1 - sin^2 C) tg C = sin C / cos C; C = atan(tg C) Теорема косинусов: c = sqrt(a^2 + b^2 - 2*a*b*cos C) Площадь: S = c*h/2; отсюда h = 2*S/c Теорема синусов: a/sin A = b/sin B = c/sin C Отсюда: sin A = a/c*sin C; sin B = b/c*sin C cos A = sqrt(1 - sin^2 A); cos B = sqrt(1 - sin^2 B) tg A = sin A/cos A; A = atan(tg A); tg B = sin B/cos B; B = atan(tg B) Периметр: P = a + b + c Теперь записываем в Паскале singam := 2*S/(a*b); cosgam = sqrt(1 - singam*singam); tangam := singam/cosgam; Gamma := atan(tangam); c := sqrt(a*a + b*b - 2*a*b*cosgam); h := 2*S/c; P := a + b + c; sinalp = a/c*singam; cosalp = sqrt(1 - sinalp*sinalp); tanalp := sinalp/cosalp; Alpha := atan(tanalp); sinbet = b/c*singam; cosbet = sqrt(1 - sinbet*sinbet); tanbet := sinbet/cosbet; Beta := atan(tanbet);
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку