fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int p;
  7. bool a = false;
  8. (a) ? (p = 1) : (p = 0);
  9. cout << p << endl;
  10. a = true;
  11. (a) ? (p = 1) : (p = 0);
  12. cout << p << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5536KB
stdin
Standard input is empty
stdout
0
1