{1} const whereInput = 'C:\Users\1\Desktop\1.txt'; // <== путь файла var input: text; n, n1, i, sum: longint; begin assign(input, WhereInput); reset(input); readln (input, n); n1:=0; sum:=0; for i:=1 to n do begin read (input, n1); inc (sum, n1); end; close (input); write ('Среднее арифметическое: ', sum/n); end.
{2} const whereInput = 'C:\Users\1\Desktop\1.txt'; var input: text; n: longint; ch: char; begin assign(input, WhereInput); reset(input); n:=0; while not eof(input) do begin read (input, ch); inc (n); if eoln(input) then readln(input); end; close (input); write ('Символов в файле: ', n); end.
{3} const whereInput = 'C:\Users\1\Desktop\1.txt'; var input: text; n, i: longint; ch: char; begin assign(input, WhereInput); reset(input); i:=0; n:=0; while not eof(input) do begin read (input, ch); inc (n); if eoln(input) then begin readln(input); inc (i); writeln ('Символов в ', i, ' строке: ', n); n:=0; end; end; close (input); end.
Var a,b,c,p:real; Begin Write('a = ');Read(a); Write('b = ');Read(b); Write('c = ');Read(c); if (a<b+c)and(b<a+c)and(c<a+b) then Begin if (a=b)and(a<>c) then Write('Треугольник равнобедренный, ') else if (a=b)and(b=c) then Write('Треугольник равносторонний, ') else if (a*a=b*b+c*c)or(b*b=a*a+c*c)or(c*c=b*b+a*a) then Write('Треугольник прямоульный, ') else Write('Треугольник никакой, '); p:=(a+b+c)/2; a:=sqrt(p*(p-a)*(p-b)*(p-c)); Write('его площадь равна ',a); End else Write('Треугольник не существует') End.