Vazirligi muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti qarshi filiali kompyuter injiniringi fakulteti ki 17-21 guruh talabasining dasturlash 2
Download 32.8 Kb.
|
3-amaliy ish
- Bu sahifa navigatsiya:
- DASTURLASH 2
O’ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGIMUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI QARSHI FILIALI KOMPYUTER INJINIRINGI FAKULTETI KI 17-21 GURUH TALABASINING DASTURLASH 2FANIDAN 3-LABORATORIYA ISHI Bajardi: JOVLIYEV.O Qabul qildi: TEMIROV.M SAVOL: 1-formada a[N][M] massiv elementlarini [N; M] oraliqdagi tasodifiy sonlar bilan to‘ldiring. N va M ni TextBox komponetasi yordamida kiriting. Massivning eng katta va eng kichik elementlari sonini 2- formaning label komponentasida chiqaring.
#include #include #include using namespace std; // Formdagi komponentlarni chaqiruvchi identifikatorlar
// Form ochilganda chaqiriladigan funksiya LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { static HWND hwndTextbox1, hwndTextbox2; static HWND hwndLabel1, hwndLabel2, hwndButton; static int n, m; static int a[100][100]; switch(msg) { case WM_CREATE: { // Textbox komponentlarini yaratish hwndTextbox1 = CreateWindowEx( WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE | ES_NUMBER, 10, 10, 50, 20, hwnd, (HMENU) IDC_TEXTBOX1, GetModuleHandle(NULL), NULL); hwndTextbox2 = CreateWindowEx( WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE | ES_NUMBER, 70, 10, 50, 20, hwnd, (HMENU) IDC_TEXTBOX2, GetModuleHandle(NULL), NULL); // Label komponentlarini yaratish hwndLabel1 = CreateWindow( "STATIC", "", WS_CHILD | WS_VISIBLE | SS_CENTER, 10, 40, 200, 20, hwnd, (HMENU) IDC_LABEL1, GetModuleHandle(NULL), NULL); hwndLabel2 = CreateWindow( "STATIC", "", WS_CHILD | WS_VISIBLE | SS_CENTER, 10, 70, 200, 20, hwnd, (HMENU) IDC_LABEL2, GetModuleHandle(NULL), NULL); // Button komponentini yaratish hwndButton = CreateWindow( "BUTTON", "Create Array", WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 10, 100, 100, 24, hwnd, (HMENU) IDC_BUTTON, GetModuleHandle(NULL), NULL); break;
case WM_COMMAND:
// Texbox komponentlardagi qiymatlar olish int n = GetDlgItemInt(hwnd, IDC_TEXTBOX1, NULL, TRUE); int m = GetDlgItemInt(hwnd, IDC_TEXTBOX2, NULL, TRUE); // Massivni tasodifiy sonlar bilan to'ldirish srand(time(NULL)); for (int i = 0; i < Download 32.8 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling