AbiloWa
31.10.2020 00:45

Составьте программу нахождения произведения наименьшего и наибольшего числа из трех паскаль​

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
csmos
17.08.2022 19:06

C# самый простой вариант. Не нравится - совершенствуйте

на форму label1, textBox1, textBox2, textBox3, button1, button2, button3, this.button4, this.button5, this.button6

в Form1.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

namespace WindowsFormsApplication1

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

double a, b, result;

private void button1_Click(object sender, EventArgs e)

{

a = Convert.ToDouble(textBox1.Text);

b = Convert.ToDouble(textBox2.Text);

label1.Text = "Сумма";

result = a + b;

textBox3.Text = Convert.ToString(result);

}

private void button2_Click(object sender, EventArgs e)

{

a = Convert.ToDouble(textBox1.Text);

b = Convert.ToDouble(textBox2.Text);

label1.Text = "Разность";

result = a - b;

textBox3.Text = Convert.ToString(result);

}

private void button3_Click(object sender, EventArgs e)

{

label1.Text = "Произведение";

textBox3.Text = Convert.ToString(Convert.ToDouble(textBox1.Text) * Convert.ToDouble(textBox2.Text));

}

private void button4_Click(object sender, EventArgs e)

{

a = Convert.ToDouble(textBox1.Text);

b = Convert.ToDouble(textBox2.Text);

label1.Text = "Частное";

result = a / b;

textBox3.Text = Convert.ToString(result);

}

private void button5_Click(object sender, EventArgs e)

{

textBox3.Text = Convert.ToString(Convert.ToDouble(textBox1.Text) * Convert.ToDouble(textBox1.Text));

}

private void button6_Click(object sender, EventArgs e)

{

textBox3.Text = Convert.ToString(Math.Sqrt(Convert.ToDouble(textBox1.Text)));

}

}

}

0,0(0 оценок)
Ответ:
kamilla195
30.03.2021 14:53
1)var a:array [1..10] of integer;      i,sum:integer;begin  randomize;  sum:=0;  for i:=1 to 10 do    begin      a[i]:=random(100)-50;      write (a[i],' ');      if a[i] < 0 then sum:=sum+a[i];      end;  writeln;  writeln ('Summa: ',sum);  readln;end.
2)var a:array [1..10] of integer;      i,max,index:integer;begin  for i:=1 to 10 do    begin       write ('A[',i,'] = ');       readln (a[i]);    end;  max:=a[1];  index:=1;  for i:=2 to 10 do    if a[i] > max then      begin        max:=a[i];        index:=i;      end;  writeln ('Max: ',max,'.Index: ',index);  readln;end.
3)var a:array [1..10] of integer;      max,min,i,temp:integer;begin  randomize;  for i:=1 to 10 do    begin       a[i]:=random(50);       write (a[i],' ');    end;  writeln;  max:=1;  min:=1;  for i:=2 to 10 do    if a[i] > a[max] then max:=i else      if a[i] < min then min:=i;  writeln ('Max: ',a[max]);  writeln ('Min: ',a[min]);  temp:=a[min];  a[min]:=a[max];  a[max]:=temp;  for i:=1 to 10 do write (a[i],' ');end.Не знаю- правильно ли?
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота