Skip to content

Instantly share code, notes, and snippets.

@cocuh
Created April 22, 2014 06:32
Show Gist options
  • Save cocuh/11167395 to your computer and use it in GitHub Desktop.
Save cocuh/11167395 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#define true 1
#define false 0
// gcc
int main(){
printf(true?true?"a":"b":"c"); // a
printf(true?false?"a":"b":"c"); // b
printf(false?true?"a":"b":"c"); // c
printf(false?false?"a":"b":"c"); // c
return 0;
}
#include<cstdio>
// g++
int main(){
printf(true?true?"a":"b":"c"); // a
printf(true?false?"a":"b":"c"); // b
printf(false?true?"a":"b":"c"); // c
printf(false?false?"a":"b":"c"); // c
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment