KondratevS200
07.03.2021 02:47

Delfi 2 Визначити робітника з мах зарплатнею й надрукувати усі відомості про нього.
Текст модуля програми
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;

Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
RadioGroup1: TRadioGroup;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Memo1: TMemo;
Memo2: TMemo;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
ComboBox1: TComboBox;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Type abitur = record
country: string[10];
oblast: string[15];
family: string[12];
sr_bal: real;
medal: char;
end;
{Опис глобальних параметрів - масиву записів та їхньої кількості }
var m_zap:array[1..20]of abitur; {масив записів}
k:integer; {поточна кількість введених записів}
// Підпрограма початкових значень проекту
procedure TForm1.FormCreate(Sender: TObject);
begin
k:=0;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
k:=k+1;
with m_zap[k] do begin
country:=ComboBox1.text;
oblast:=Edit1.text;

family:=Edit2.text;
sr_bal:=StrToFloat(Edit3.Text);
Case RadioGroup1.ItemIndex of
0:medal:='з';
1: medal:='с';
2: medal:='н';
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
k:=0;
//СomboBox1.Clear;
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
Memo1.Clear;
Memo2.Clear;
end;
procedure TForm1.Button3Click(Sender: TObject);
var sbal,dan:string;
smed:string;
i:integer;
begin
Memo1.Clear;
Memo1.Lines.Add('| Фамилия | Страна | Область | Средний бал| Медаль|');
for i:=1 to k do
with m_zap[i] do begin
case medal of
'з': smed:='золота';
'с': smed:='срібна';
'н': smed:='немає';
end;
str(sr_bal:5:2,sbal);
dan:=family+' | '+country+' | '+oblast+ ' | '+ sbal+' | '+ smed; Memo1.Lines.Add(dan);
end;
end;
procedure TForm1.Button4Click(Sender: TObject);
var sbal,dan:string;
smed:string;
i:integer;
begin memo2.Lines.Add('Медалисты');
for i:=1 to k do
with m_zap[i] do
if (medal='з') Or (medal='с') then

begin
case medal of
'з': smed:='золотая';
'с': smed:='серебрянная';
end;
dan:=family+' | '+country+' | '+ smed; memo2.Lines.Add(dan);
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
close;
end; end.


Delfi 2 Визначити робітника з мах зарплатнею й надрукувати усі відомості про нього. Текст модуля про

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Electron57
13.03.2023 05:28

#include <iostream>

#include <algorithm>

using namespace std;

int main()

{

int n(0),m(0);

cin >> n >> m;

int matrix[n][m];

char arr[n][m];

arr[0][0] = '0';

for(int i = 0;i<n;++i){

for(int j = 0;j<m;++j){

cin >> matrix[i][j];

if(!i && !j)continue;

if(!i){

matrix[i][j] += matrix[i][j-1];

arr[i][j] = 'R';

}

if(!j){

matrix[i][j] += matrix[i-1][j];

arr[i][j] = 'D';

}

if(i && j){

matrix[i][j] += max(matrix[i-1][j],matrix[i][j-1]);

if(max(matrix[i-1][j],matrix[i][j-1]) == matrix[i-1][j])arr[i][j] = 'D';

else arr[i][j] = 'R';

}

}

}

cout << matrix[n-1][m-1];

cout << "\n";

string s;

for(int i = n-1;;){

for(int j = m-1;;){

if(arr[i][j] == '0'){

reverse(s.begin(),s.end());

s.erase(0,1);

cout << s << endl;

return 0;

}

s.push_back(arr[i][j]);

s.push_back(' ');

if(arr[i][j] == 'R'){

j -= 1;

continue;

}

if(arr[i][j] == 'D'){

i -= 1;

continue;

}

}

}

cout << endl;

return 0;

}

Объяснение:

0,0(0 оценок)
Ответ:
Mv0856
05.07.2021 13:16

#include <iostream>

#include <vector>

using namespace std;

int data[20][20], x, y, minValue = -1;  

void calc(int px, int py, int value){  

  value += data[px][py];

  int temp = data[px][py];

 if(px == x - 1 && py == y - 1) {

      if(value < minValue || minValue == -1)

          minValue = value;

      return;

 }

 data[px][py] = -1;

  if(px + 1 < x && data[px + 1][py] != -1) calc(px + 1, py, value);

  if(py + 1 < y && data[px][py + 1] != -1) calc(px, py + 1, value);

data[px][py] = temp;

}

int main(){

  cin >> x >> y;

  for (int i = 0; i < x; ++i)

      for (int j = 0; j < y; ++j)

         cin >> data[i][j];

calc(0, 0, 0);

 cout << minValue;  

 return 0;

}

Объяснение:

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота