Составить блок-схему алгоритма и программу на языке Паскаль для вычисления значения функции. Ввести программу, вычислить значение функции и проверить полученный результат. На проверку нужно прислать блок-схему алгоритма, текст кода программы, результат работы кода в виде скриншота окна программы с отображением кода и полученного результата. Входные данные задайте самостоятельно. Программная реализация обязательна!
//Описание добавить не вышло на сайт, посему - в файле
#include "stdafx.h" #include <conio.h>
void swap(short &a, short &b) { short c = a; a = b;
b = c; }
void sort(short &a, short &b, short &c) { short min = a, max = c; if (min > b) min = b; if (min > c) min = c; if (max < a) max = a; if (max < b) max = b; b = a + b + c - min - max; a = min; c = max; }
if ((a1 == a2) && (b1 == b2) && (c1 == c2)) printf("Boxes are equal"); else if ((a1 <= a2) && (b1 <= b2) && (c1 <= c2)) printf_s("The first box is smaller than the second one"); else if ((a2 <= a1) && (b2 <= b1) && (c2 <= c1)) printf_s("The first box is larger than the second one"); else printf_s("Boxes are incomparable");
Var i,j: integer; chislo: string; begin chislo:='12323'; for j:=1 to 14 do begin i:=1; while i<=length(chislo) do begin if copy(chislo,i,1)='1' then begin delete(chislo,i,1);insert('33',chislo,i); inc(i); end; inc(i); end; i:=1; while i<=length(chislo) do begin if copy(chislo,i,1)='2' then begin delete(chislo,i,1);insert('1',chislo,i); end; inc(i); end; i:=1; while i<=length(chislo) do begin if copy(chislo,i,1)='3' then begin delete(chislo,i,1);insert('2',chislo,i); end; inc(i); end; end; Writeln(chislo); readln; end.
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку