Advertisement
Guest User

Untitled

a guest
May 26th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. //---------------------------------------------------------------------------
  2. #include  <Dateutils.hpp>
  3. #include <vcl.h>
  4. #pragma hdrstop
  5. #include <stdio.h>
  6. #include "Unit1.h"
  7. //---------------------------------------------------------------------------
  8. #pragma package(smart_init)
  9. #pragma resource "*.dfm"
  10. TForm1 *Form1;
  11. //---------------------------------------------------------------------------
  12. __fastcall TForm1::TForm1(TComponent* Owner)
  13.         : TForm(Owner)
  14. {
  15. }
  16. //---------------------------------------------------------------------------
  17. FILE *f;
  18. char *fn = "a.txt";
  19. char date[10],dateMax[10];
  20. void __fastcall TForm1::Button1Click(TObject *Sender)
  21. {
  22. TDate d1=0,dMax=0;
  23. Memo1->Clear();
  24. f=fopen(fn,"rt");
  25. if(f==0){ShowMessage("Âñå î÷åíü ïëîõî");}
  26. while(fscanf(f,"%s", &date) > 0){
  27.         d1 = StrToDate(date);
  28.         if(d1.Val>dMax.Val){
  29.                 dMax=d1;
  30.         }
  31.         Memo1->Lines->Add(DateToStr(dMax));
  32. }
  33. }
  34. //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement