Відповідь:
Пояснення:
//Реализация задачи №1 "A+B" на C
#include < stdio.h >
long a,b;
int main(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
scanf("%ld%ld",&a,&b);
printf("%ld",a+b);
return 0;
}
7
{Реализация задачи №1 "A+B" на Pascal}
var a, b : longint;
begin
assign(input, 'input.txt'); reset(input);
assign(output, 'output.txt'); rewrite(output);
read(a, b);
write(a + b);
end.
//Реализация задачи №1 "A+B" на Java
import java.util.*;
import java.io.*;
public class Main{ //имя класса должно быть Main
public static void main(String[] argv) throws IOException{
new Main().run();
}
PrintWriter pw;
Scanner sc;
public void run() throws IOException{
sc = new Scanner(new File("input.txt"));
int a=sc.nextInt(), b=sc.nextInt();
pw = new PrintWriter(new File("output.txt"));
pw.print(a+b);
pw.close();
}
}
'Реализация задачи №1 "А+В" на Basic
open "input.txt" for input as #1
open "output.txt" for output as #2
input #1,a#,b#
print #2,a#+b#
close #1
close #2
Сторону равностороннего треугольника можно вычислить по формуле -
a=\frac{2h}{\sqrt{3} }a=
3
2h
Где а - длина стороны равностороннего треугольника, h - длина высоты равностороннего треугольника.
Подставим в формулу известные нам значения -
\begin{lgathered}a=\frac{2*6\sqrt{3} }{\sqrt{3} }a=12\end{lgathered}
a=
3
2∗6
3
a=12
a = 12 см.
Площадь равностороннего треугольника можно вычислить по формуле -
S =\frac{a^{2} \sqrt{3} }{4}S=
4
a
2
3
Где S - площадь равностороннего треугольника.
Подставим в формулу известные нам значения -
\begin{lgathered}S =\frac{12^{2} \sqrt{3} }{4}S =\frac{144\sqrt{3} }{4}S = 36\sqrt{3}\end{lgathered}
S=
4
12
2
3
S=
4
144
3
S=36
Поделитесь своими знаниями, ответьте на вопрос:
Напишите программу для pascal к уравнению ax^2+bx+c=0
End else Begin x :=-c / b; Writeln ('Root x=' ,x:8:2); Readln; Halt End else Begin D :=Sqr (b) - 4 * a * c; if D<0 then Begin Writeln ('The equation has no real roots');
readln; Halt End else Begin x:=-b /( 2 * a ); if D = 0 then Begin Writeln ('Roots are equal x1=x2=', x:8:2); Readln; Halt End; x2:= Sqrt (D)/(2*a); x1:= x2 + x; x2:= x - x2; Writeln('Roots: x1=',x1:8:2, ' x2= ',x2:8:2) EndEnd; Readln;End.