Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *&---------------------------------------------------------------------*
- *& Report Y_LAB6_GRIGORE
- *&
- *&---------------------------------------------------------------------*
- *&
- *&
- *&---------------------------------------------------------------------*
- REPORT Y_LAB6_GRIGORE.
- DATA int TYPE I.
- int = 10.
- DATA float TYPE F.
- float = '1.234'.
- DATA ari TYPE D.
- ari = '20190307'.
- DATA ora TYPE T.
- ora = '103719'.
- DATA nume TYPE C.
- nume = 'GRIGORE'.
- WRITE: int, / float, / ari ,/ ora ,/ nume.
- *& DATA f TYPE I OCCURS 3.
- *& INSERT 1 INTO f INDEX 0.
- *& INSERT 2 INTO f INDEX 1.
- *& INSERT 3 INTO f INDEX 2.
- DATA n1 TYPE F.
- DATA n2 TYPE F.
- DATA n3 TYPE F.
- DATA n4 TYPE F.
- n1 = '10.10'.
- n2 = '10.20'.
- n3 = '10.30'.
- n4 = '10.40'.
- DATA: BEGIN OF struct,
- v1 TYPE I,
- v2 TYPE I,
- END OF struct.
- struct-v1 = 10.
- struct-v2 = 20.
- WRITE:/ 'Struct v1: ', struct-v1, ' Struct v2: ', struct-v2.
- WRITE:/ 'Numarul maxim este: '.
- IF n1 > n2 AND n1 > n3 AND n1 > n4.
- WRITE: n1.
- ENDIF.
- IF n2 > n1 AND n2 > n3 AND n2 > n4.
- WRITE: n2.
- ENDIF.
- IF n3 > n2 AND n3 > n1 AND n3 > n4.
- WRITE: n3.
- ENDIF.
- IF n4 > n1 AND n4 > n2 AND n4 > n3.
- WRITE: n4.
- ENDIF.
- WRITE: /.
- DATA numar_div TYPE I.
- DATA NUMAR_DOI TYPE I.
- DATA NUMAR_TREI TYPE I.
- DATA NUMAR_CINCI TYPE I.
- DATA NUMAR_SAPTE TYPE I.
- numar_div = 25.
- NUMAR_DOI = numar_div MOD 2.
- NUMAR_TREI = numar_div MOD 3.
- NUMAR_CINCI = numar_div MOD 5.
- NUMAR_SAPTE = numar_div MOD 7.
- IF NUMAR_DOI = 0.
- WRITE: numar_div , 'este divizibil cu 2'.
- ENDIF.
- IF NUMAR_TREI = 0.
- WRITE: numar_div , 'este divizibil cu 3'.
- ENDIF.
- IF NUMAR_CINCI = 0.
- WRITE: numar_div , 'este divizibil cu 5'.
- ENDIF.
- IF NUMAR_SAPTE = 0.
- WRITE: numar_div , 'este divizibil cu 7'.
- ENDIF.
- DATA a1 TYPE I.
- DATA b1 TYPE I.
- DATA c1 TYPE I.
- DATA d1 TYPE I.
- DATA x1 TYPE I.
- DATA delta TYPE I.
- DATA delta1 TYPE I.
- DATA x11 TYPE I.
- DATA x12 TYPE I.
- DATA sol TYPE I.
- a1 = 8.
- b1 = 7.
- c1 = 1.
- IF a1 = 0.
- IF b1 = 0.
- IF c1 = 0.
- WRITE: /'Exista o infinitate de solutii !'.
- ELSE.
- WRITE: /'Ecuatie imposibila!'.
- ENDIF.
- ELSE.
- WRITE: /'Ecuatie de gr 1 cu o solutie '.
- x1 = ( - c1 ) / b1.
- WRITE: x1.
- ENDIF.
- ELSE.
- delta = b1 * b1.
- delta1 = 4 * a1 * c1.
- delta = delta - delta1.
- IF delta < 0.
- WRITE: /'Ecuatia nu are solutii reale !'.
- ELSE.
- IF delta = 0.
- sol = ( - b1 ) / ( 2 * a1 ).
- WRITE: /'Ecuatia are solutii egale '.
- WRITE: 'x1=x2= ', sol.
- ELSE.
- x11 = ( - b1 + sqrt( delta ) ) / 2 * a1.
- x12 = ( - b1 + sqrt( delta ) ) / 2 * a1.
- WRITE: /'Ecuatia are solutii reale! '.
- WRITE: ' x1 = ', x11.
- WRITE: ' x2 = ', x12.
- ENDIF.
- ENDIF.
- ENDIF.
- DATA numar_text TYPE I.
- numar_text = 10.
- CASE numar_text.
- WHEN 0.
- WRITE: / 'Zero'.
- WHEN 1.
- WRITE: / 'Unu'.
- WHEN 2.
- WRITE: / 'Doi'.
- WHEN 3.
- WRITE: / 'Trei'.
- WHEN 4.
- WRITE: / 'Patru'.
- WHEN 5.
- WRITE: / 'Cinci'.
- WHEN 6.
- WRITE: / 'Sase'.
- WHEN 7.
- WRITE: / 'Sapte'.
- WHEN 8.
- WRITE: / 'Opt'.
- WHEN 9.
- WRITE: / 'Noua'.
- WHEN 10.
- WRITE: / 'Zece'.
- ENDCASE.
- DATA numar_1 TYPE F.
- DATA numar_2 TYPE F.
- DATA operator TYPE C.
- operator = '+'.
- numar_1 = '10.20'.
- numar_2 = '20.30'.
- DATA rezultat TYPE F.
- rezultat = 0.
- CASE operator.
- WHEN '+'.
- rezultat = numar_1 + numar_2.
- WHEN '-'.
- rezultat = numar_1 - numar_2.
- WHEN '*'.
- rezultat = numar_1 * numar_2.
- WHEN '/'.
- rezultat = numar_1 / numar_2.
- WHEN '%'.
- rezultat = numar_1 MOD numar_2.
- ENDCASE.
- WRITE: / 'Rezultatul este: ', rezultat.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement