Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------------
- #include <Dateutils.hpp>
- #include <vcl.h>
- #pragma hdrstop
- #include <stdio.h>
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- FILE *f;
- char *fn = "a.txt";
- char date[10],dateMax[10];
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- TDate d1=0,dMax=0;
- Memo1->Clear();
- f=fopen(fn,"rt");
- if(f==0){ShowMessage("Âñå î÷åíü ïëîõî");}
- while(fscanf(f,"%s", &date) > 0){
- d1 = StrToDate(date);
- if(d1.Val>dMax.Val){
- dMax=d1;
- }
- Memo1->Lines->Add(DateToStr(dMax));
- }
- }
- //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement