Differenza numeri alti

Materie:Appunti
Categoria:Informatica

Voto:

2.5 (2)
Download:64
Data:06.11.2000
Numero di pagine:2
Formato di file:.txt (File di testo)
Download   Anteprima
differenza-numeri-alti_1.zip (Dimensione: 1 Kb)
trucheck.it_differenza-numeri-alti.txt     3.13 Kb
readme.txt     59 Bytes



Testo

//---------------------------------------------------------------------------
#include
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
const int max=99;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
maxint(int a, int b)
{
return((a>b)?a:b);
}

//---------------------------------------------------------------------------
char trasf(char c)
{
if (c!=8) if ((c'9')) c=0;
return(c);
}

AnsiString riempi (AnsiString s)
{
int l;
l=CharToByteLen(s,max+1);
for (;l=0);n--);
return(n);
}

void spaccamento(AnsiString s, char t[], int *n)
{
int l, i;
l=CharToByteLen(s,max+1);
for (i=1;i=0;i--)
{
t[i]+='0';
s=s+t[i];
}
return(s);
}

void differenza(char t1[], char t2[], char t3[], int n1, int n2, int *n3)
{
int i;
*n3=maxint(n1,n2);
for (i=n1+1;iEnabled=True;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Application->Terminate();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Edit1->Text="";
Edit2->Text="";
Edit3->Text="";
Edit1->SetFocus();
Button1->Enabled=True;
Button2->Enabled=False;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &Key)
{
Key=trasf(Key);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit2KeyPress(TObject *Sender, char &Key)
{
Key=trasf(Key);
}
//---------------------------------------------------------------------------

Esempio



  



Come usare