#include < iostream> using namespace std; int main() { //объявление переменных int a,b,c,min,max; //вводим числа cout< < "введите а "< < endl; cin> > a; cout< < "введите b"< < endl; cin> > b; cout< < "введите c"< < endl; cin> > c; //ищем максимальное число if (a> =b & & a> =c) {max=a; } else {if (b> =a & & a> =c) {max=b; } else max=c; } //ищем минимальное число if (a< =b & & a< =c) {min=a; } else {if (b< =a & & a< =c) {min=b; } else min=c; } //вывод переменных cout< < "максимальное число = "< < max< < endl; cout< < "минимальное число = "< < min< < endl; system("pause" ); return 0; }
o-pavlova-8635
10.05.2023
{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.