identificationdivision. program-id. maxmin. author. " Gannod/Cheng - Strongest Postcondition". date-written. 2.1.2006. datadivision. working-storagesection.
77 a pic 9(4)V99.
77 b pic 9(4)V99.
77 c pic 9(4)V99.
77 Largest pic 9(4)V99.
77 Smallest pic 9(4)V99. proceduredivision. move 5 to a move 10 to b call swapa using a, b call swapb using a, b call funnyswap using a, b call FindMaxMin using a, b, Largest, Smallest move Largest to c end-program maxmin.
identificationdivision. program-id. FindMaxMin. author. " Gannod/Cheng - Strongest Postcondition". date-written. 2.1.2006. datadivision. linkagesection.
77 NumOne pic 9(4)V99.
77 NumTwo pic 9(4)V99.
77 Maxx pic 9(4)V99.
77 Minn pic 9(4)V99. proceduredivisionusing NumOne, NumTwo, Maxx, Minn. if NumOne > NumTwo then move NumOne to Maxx move NumTwo to Minn else move NumTwo to Maxx move NumOne to Minn end-if end-program FindMaxMin.
identificationdivision. program-id. swapa. author. " Gannod/Cheng - Strongest Postcondition". date-written. 2.1.2006. datadivision. linkagesection.
77 X pic 9(4)V99.
77 Y pic 9(4)V99. proceduredivisionusing X, Y. add X to Y subtract X from Y giving X subtract X from Y end-program swapa.
identificationdivision. program-id. swapb. author. " Gannod/Cheng - Strongest Postcondition". date-written. 2.1.2006. datadivision. working-storagesection.
77 temp pic 9(4)V99. linkagesection.
77 X pic 9(4)V99.
77 Y pic 9(4)V99. proceduredivisionusing X, Y. move X to temp move Y to X move temp to Y end-program swapb.
identificationdivision. program-id. funnyswap. author. " Gannod/Cheng - Strongest Postcondition". date-written. 2.1.2006. datadivision. working-storagesection.
77 temp pic 9(4)V99. linkagesection.
77 X pic 9(4)V99.
77 Y pic 9(4)V99. proceduredivisionusing X, Y. move temp to X move Y to X move temp to Y end-program funnyswap.
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.