fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a = 1, b = 2;
  8.  
  9. true ? a : b = 7;
  10. cout << a << ' ' << b << endl;
  11.  
  12. false ? a : b = 8;
  13. cout << a << ' ' << b << endl;
  14.  
  15. (true ? a : b) = 9;
  16. cout << a << ' ' << b << endl;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
1 2
1 8
9 8