Skip to main content
added 253 characters in body
Source Link
celtschk
  • 4.7k
  • 2
  • 23
  • 21

CPP, 2727 25

main=print({-/*-}1{-*/-})

Try it online!

Prints () for -XCPP and 1 for -XNoCPP

Previous version:

main=print[1{-/*-},2{-*/-}]

Try it online!

Prints [1] with -XCPP and [1,2] otherwise.

Credits: This is inspired by Laikoni's answer, but instead of a #define it simply uses C comments.

CPP, 27

main=print[1{-/*-},2{-*/-}]

Try it online!

Prints [1] with -XCPP and [1,2] otherwise.

Credits: This is inspired by Laikoni's answer, but instead of a #define it simply uses C comments.

CPP, 27 25

main=print({-/*-}1{-*/-})

Try it online!

Prints () for -XCPP and 1 for -XNoCPP

Previous version:

main=print[1{-/*-},2{-*/-}]

Try it online!

Prints [1] with -XCPP and [1,2] otherwise.

Credits: This is inspired by Laikoni's answer, but instead of a #define it simply uses C comments.

Source Link
celtschk
  • 4.7k
  • 2
  • 23
  • 21

CPP, 27

main=print[1{-/*-},2{-*/-}]

Try it online!

Prints [1] with -XCPP and [1,2] otherwise.

Credits: This is inspired by Laikoni's answer, but instead of a #define it simply uses C comments.