Choosing a future profession is a very important step in everyone's life. Some school leavers hesitate for a long time, as it is difficult for them to decide, while others, on the contrary, make a firm decision earlier. In order to become what you want, you must first learn and get an education. If you like your future profession very much, then it will be interesting and not difficult to study.
As for me, I want to become a programmer. This profession attracted me when I was in elementary school. Then we started studying computer science, which became my favorite subject. I always listen very carefully to the teacher. I am interested in absolutely all topics on this subject, so I often ask a lot of additional questions in the lessons. At home, I have many different books: about the structure of the computer, about working with different programs, about the basics of programming, about breakdowns, about viruses, and others. In addition, I usually read additional literature on computer science in our school library or search for information that interests me on the Internet.
Без проверки полагаем, что по заданным координатам точек можно построить треугольники.
//PascalABC.Net 3.0, сборка 1111 type Point=record x,y:double end;
function TriangleSquare(A,B,C:Point):double; begin Result:=0.5*abs(A.x*(B.y-C.y)+B.x*(C.y-A.y)+C.x*(A.y-B.y)) end;
procedure GetPoint(c:char; var A:Point); begin Write('Введите координаты точки ',c,': '); Readln(A.x,A.y) end;
var A:array['A'..'F'] of Point; i:'A'..'F'; s1,s2:double; begin for i:='A' to 'F' do GetPoint(i,A[i]); s1:=TriangleSquare(A['A'],A['B'],A['C']); s2:=TriangleSquare(A['D'],A['E'],A['F']); if s1>s2 then Writeln('Площадь первого треугольника больше') else if s2>s1 then Writeln('Площадь второго треугольника больше') else Writeln('Площади треугольников равны') end.
Тестовое решение: Введите координаты точки A: -4 3.7 Введите координаты точки B: -6.3 0 Введите координаты точки C: 10.2 5.93 Введите координаты точки D: 7.143 8.1 Введите координаты точки E: -6 -3 Введите координаты точки F: 7.4 -5.7 Площадь второго треугольника больше
Choosing a future profession is a very important step in everyone's life. Some school leavers hesitate for a long time, as it is difficult for them to decide, while others, on the contrary, make a firm decision earlier. In order to become what you want, you must first learn and get an education. If you like your future profession very much, then it will be interesting and not difficult to study.
As for me, I want to become a programmer. This profession attracted me when I was in elementary school. Then we started studying computer science, which became my favorite subject. I always listen very carefully to the teacher. I am interested in absolutely all topics on this subject, so I often ask a lot of additional questions in the lessons. At home, I have many different books: about the structure of the computer, about working with different programs, about the basics of programming, about breakdowns, about viruses, and others. In addition, I usually read additional literature on computer science in our school library or search for information that interests me on the Internet.
Объяснение:
//PascalABC.Net 3.0, сборка 1111
type
Point=record
x,y:double
end;
function TriangleSquare(A,B,C:Point):double;
begin
Result:=0.5*abs(A.x*(B.y-C.y)+B.x*(C.y-A.y)+C.x*(A.y-B.y))
end;
procedure GetPoint(c:char; var A:Point);
begin
Write('Введите координаты точки ',c,': ');
Readln(A.x,A.y)
end;
var
A:array['A'..'F'] of Point;
i:'A'..'F';
s1,s2:double;
begin
for i:='A' to 'F' do GetPoint(i,A[i]);
s1:=TriangleSquare(A['A'],A['B'],A['C']);
s2:=TriangleSquare(A['D'],A['E'],A['F']);
if s1>s2 then Writeln('Площадь первого треугольника больше')
else
if s2>s1 then Writeln('Площадь второго треугольника больше')
else Writeln('Площади треугольников равны')
end.
Тестовое решение:
Введите координаты точки A: -4 3.7
Введите координаты точки B: -6.3 0
Введите координаты точки C: 10.2 5.93
Введите координаты точки D: 7.143 8.1
Введите координаты точки E: -6 -3
Введите координаты точки F: 7.4 -5.7
Площадь второго треугольника больше