Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <cmath>
- #include <stdlib.h>
- #define m 15
- int i,n,p;
- int A[m];
- #pragma endregion
- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
- if(textBox1->Text!="") {n=Convert::ToInt32(textBox1->Text); }
- else {MessageBox::Show( "Заполните пожалуйста данные", "Ошибка ввода данных", MessageBoxButtons::OK, MessageBoxIcon::Exclamation );}
- {textBox2->Text = "";
- for (i = 0; i < n; ++i)
- {
- A[i] = rand ( ) % 121-50;
- this->textBox2->AppendText(A[i]+" ");
- }
- }
- }
- private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
- int min=A[0]; int max=A[0]; int mn=0; int ch=0;
- for (i = 0; i < n; ++i)
- {
- if (abs(A[i])%4==true){ch=ch+1;}
- if (A[i]<0){mn=mn+A[i];}
- if (A[i]<min){min=A[i];}
- if (A[i]>max){max=A[i];}
- }
- if (checkBox1->Checked==true){this->textBox3->Text=Convert::ToString (ch);}
- if (checkBox2->Checked==true){this->textBox4->Text=Convert::ToString (mn);}
- if (checkBox3->Checked==true){this->textBox5->Text=Convert::ToString (min+max);}
- }
- private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { Application::Exit();
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment