diff options
Diffstat (limited to 'conditional-operator-tests.cpp')
-rw-r--r-- | conditional-operator-tests.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/conditional-operator-tests.cpp b/conditional-operator-tests.cpp new file mode 100644 index 0000000..570b4ec --- /dev/null +++ b/conditional-operator-tests.cpp @@ -0,0 +1,22 @@ +#include <iostream> + +/* + * + * + * + * + */ + +int main () { + + unsigned int grade = 0; + if(std::cin >> grade) { + if(grade > 100) { return -1; } + + } else { + return -1; + } + + std::cout << (grade < 60 ? "fail" : "pass") << std::endl; + return 0; +} |