#include <vcl.h>
#pragma hdrstop
#include "Unit20.h"
#pragma package(smart_init)
#pragma link "CSPIN"
#pragma resource "*.dfm"

TForm1 *Form1;
//---------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  int kwota;         //kwota do rozmienienia
  int b50, b20, b10; // ilosc banknotow 50, 20,10 zlotowych
  int r50, r20, r10; // reszta z banknotów

  kwota = CSpinEdit1->Value;   
  b50 = kwota/50;
  r50 = kwota % 50;
  b20 = r50/20;
  r20 = r50 % 20;
  b10 = r20/10;

  Edit1->Text = IntToStr(b50);
  Edit2->Text = IntToStr(b20);
  Edit3->Text = IntToStr(b10);
}
//---------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
  Application->Terminate();
}
//---------------------------------------------------------

