Last active
August 29, 2015 14:01
-
-
Save radbasa/bcfcd4e7667aee86c246 to your computer and use it in GitHub Desktop.
optimization exercise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// all input data validated | |
// w: boolean | |
// x: int age | |
// z: 'M' or 'F' | |
#define true 1 | |
#define false 0 | |
if ( w == true ) { | |
if ( z == "M" ) { | |
if ( x >= 20 && x <= 65 ) { | |
// statements 1 | |
} else if ( x < 20 ) { | |
// statements 3 | |
} | |
} else { | |
if ( x >= 20 ) { | |
if ( x <= 65 ) { | |
// statements 1 | |
// statements 2 | |
} else { | |
// statements 2 | |
} | |
} | |
} | |
} else { | |
if ( z == "M" ) { | |
if ( x < 20 ) { | |
// statements 3 | |
} | |
} else { | |
if ( x >= 20 ) { | |
// statements 2 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment