Guruh Abdusharip Allakuliyev 11-Amaliy ish Mavzu: Komponenta xususiyatlari va hodisalari


Download 18.96 Kb.
Sana19.06.2023
Hajmi18.96 Kb.
#1603955
Bog'liq
Abdusharip Allakuliyev 11-amaliyot


942-22 guruh Abdusharip Allakuliyev
11-Amaliy ish
Mavzu: Komponenta xususiyatlari va hodisalari. Standart, Additional, System komponentalari
Topshiriq :

  1. Formada [N][M] massiv elementlarini [-100; 100] oraliqdagi tasodifiy sonlar bilan to’ldiring. N va M ni TextBox komponetalari yordamida kiriting. Massivni dataGridWiew komponentasiga joylashtiring. Uning eng katta va eng kichik elementini toping va label komponentasida chiqaring.


private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {


int n = Convert::ToInt32(textBox1->Text);
int m = Convert::ToInt32(textBox2->Text);
dataGridView1->RowCount = n;
dataGridView1->ColumnCount = m;
int a[10][10];
int min1 = 0, max1 = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = -1000 + (rand() % 2000);
dataGridView1->Rows[i]->Cells[j]->Value = Convert::ToString(a[i][j]);
int s = System::Convert::ToDouble(dataGridView1->Rows[i]->Cells[j]->Value);
if (s >= max1)max1 = a[i][j];
if (s <= min1)min1 = a[i][j];

}
}

label6->Text = "Minimum value: " + System::Convert::ToString(min1) + "\nMaximum value: " + System::Convert::ToString(max1);




}
Download 18.96 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling