Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 14th, 2012  |  syntax: None  |  size: 0.93 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var
  2.  
  3.         a,b,c,d,e,f,
  4.         h,h1,min,min1,sec,sec1,
  5.         all_h,all_min,all_sec:integer;
  6.  
  7. begin
  8.         write('Enter hours, minutes, seconds:');
  9.         readln(h,min,sec);
  10.         write('Enter hours, minutes, seconds(past time):');
  11.         readln(h1,min1,sec1);
  12.  
  13.                 all_h:=h+h1;
  14.                 all_min:=min+min1;
  15.                 all_sec:=sec+sec1;
  16.  
  17.         if
  18.                 ( all_sec > 59 )
  19.  
  20.         then
  21.                 a:=all_sec mod 60;
  22.                 b:=all_sec mod 60;
  23.                 c:=all_min+b;
  24.  
  25.         else
  26.               begin
  27.         if
  28.                 ( all_min > 59 )
  29.         then
  30.                 d:=all_min mod 60;
  31.                 e:=all_h+d
  32.  
  33.         else
  34.               begin
  35.         if
  36.                 ( all_h > 24 )
  37.         then
  38.                 f:=all_h mod 24;
  39.  
  40.         else writeln(f,'day(s)',e,'hour(s)',c,'min(s)',a,'sec(s)');
  41.  
  42.        end;
  43.         readln;
  44. end.