Advertisement
crystalshine

Untitled

Dec 16th, 2015
3,229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DEFINE VARIABLE i_width AS INTEGER NO-UNDO.
  2. DEFINE VARIABLE i_height AS INTEGER NO-UNDO.
  3. DEFINE VARIABLE i_length AS INTEGER NO-UNDO.
  4. DEFINE VARIABLE i_smallest AS INTEGER NO-UNDO.
  5. DEFINE VARIABLE i_surface AS INTEGER NO-UNDO.
  6. DEFINE VARIABLE i_temp AS INTEGER NO-UNDO.
  7. DEFINE VARIABLE s_row AS CHARACTER NO-UNDO.
  8.  
  9. INPUT FROM "d2inp.txt".
  10. DO WHILE TRUE ON ENDKEY UNDO, LEAVE:  
  11.    IMPORT UNFORMATTED s_row.
  12.    ASSIGN
  13.       i_width = INTEGER(ENTRY(1, s_row, 'x'))
  14.       i_height = INTEGER(ENTRY(2, s_row, 'x'))
  15.       i_length = INTEGER(ENTRY (3, s_row, 'x')).
  16.    {cntsquares.i i_width i_height}
  17.    {cntsquares.i i_width i_length}
  18.    {cntsquares.i i_height i_length}
  19.    i_surface = i_surface + i_smallest.
  20.    i_smallest = 0.
  21.  
  22.    
  23. END.
  24.  
  25.    DISPLAY i_surface .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement