• TextBox
  • include include //--------------------------------------------------------------------------- pragma package(smart_init)
  • __fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner) { }
  • – rasm. Dastur oynasi. 1-jadval




    Download 340,43 Kb.
    bet4/5
    Sana13.05.2024
    Hajmi340,43 Kb.
    #229987
    1   2   3   4   5
    Bog'liq
    8-variantmustaqilishi

    1.8 – rasm. Dastur oynasi.

    1-jadval



    Variantlar

    8

    Formada a[N][M] massiv elementlarini [125; 1000] oraliqdagi tasodifiy sonlar bilan to’ldiring. N va M ni TextBox komponetalari yordamida kiriting. Massivni dataGridWiew komponentasiga joylashtiring. Bu massivning bosh diagonal elementlarini kamayish tartibida label komponentasida chiqaring.


    Dastur kodi
    #include
    #pragma hdrstop

    #include "Unit2.h"
    #include
    #include
    #include
    #include
    //---------------------------------------------------------------------------
    #pragma package(smart_init)
    #pragma resource "*.dfm"
    TForm2 *Form2;

    //---------------------------------------------------------------------------
    __fastcall TForm2::TForm2(TComponent* Owner)
    : TForm(Owner)
    {
    }

    //---------------------------------------------------------------------------
    void __fastcall TForm2::Button1Click(TObject *Sender)
    {
    int N = StrToInt(Edit1->Text); // Edit1 dan N ni olish
    int M = StrToInt(Edit2->Text); // Edit2 dan M ni olish

    StringGrid1->RowCount = N + 1; // Set row count, +1 for 0-based index
    StringGrid1->ColCount = M + 1; // Set column count, +1 for 0-based index

    srand(time(NULL)); // Seed random number generator


    Download 340,43 Kb.
    1   2   3   4   5




    Download 340,43 Kb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    – rasm. Dastur oynasi. 1-jadval

    Download 340,43 Kb.