karlangadas

Untitled

Oct 30th, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.15 KB | None | 0 0
  1. program pascua;
  2. var arch:Text;
  3.   aa,mes,dd,hh,min,i:Integer;
  4. begin
  5.   aa := 2020;
  6.   mes := 5;
  7.   dd := 7;
  8.   hh := 5;
  9.   min := 45;
  10.   assign(arch,'Reporte.txt');
  11.   rewrite(arch);
  12.   writeln('Las fechas son:');
  13.   for i:=1 to 70 do begin
  14.     inc(min,44);
  15.     if (min>59) then begin
  16.       dec(min,60);
  17.       inc(hh);
  18.     end;
  19.     inc(hh,12);
  20.     if(hh>23)then begin
  21.       dec(hh,24);
  22.       inc(dd);
  23.     end;
  24.     inc(dd,29);
  25.     if ((mes=1) or (mes=3) or (mes=5) or (mes=7) or (mes=8) or (mes=10)or (mes=12)) then begin
  26.       dec(dd,31);
  27.       inc(mes);
  28.     end;
  29.     if (mes=2) then begin
  30.       if(aa mod 4 = 0) then begin
  31.         if(dd>29) then begin
  32.           dec(dd,29);
  33.           inc(mes);
  34.         end;
  35.       end else begin
  36.         if(dd>28) then begin
  37.           dec(dd,28);
  38.           inc(mes);
  39.         end;
  40.       end;
  41.     end;
  42.     if( (mes=4) or (mes=6) or (mes=9) or (mes=11) ) then begin
  43.       if dd>30 then begin
  44.         dec(dd,30);
  45.         inc(mes);
  46.       end;
  47.     end;
  48.     if(mes>12)then begin
  49.       dec(mes,12);
  50.       inc(aa);
  51.     end;
  52.     writeln(arch,'-  ',hh:2,':',min:2,'    ',dd:2,'/',mes:2,'/',aa:4);
  53.   end;
  54. end.
Advertisement
Add Comment
Please, Sign In to add comment