mpdevine@watdaisy.UUCP (Michel P. Devine) (07/02/86)
As I promised earlier, here is a program solving the 'liar' problem for
C, Pascal and Fortran. It is a slight variation on the earlier solution.
(*dumb),
c; main() { puts ("Compiled by a C compiler"); } /*)
program liar (*
*) (output); (*
*) begin
writeln (*
1 ( *,* ) 'Compiled by a FORTRAN compiler'
*) ('Compiled by a Pascal compiler');
end . (*/
#define end_pascal_comment *)
Several people have responded with various solutions. It appears that this one
is the 'cleanest' (if such a criterion is indeed valid, given the context :-)
I have yet seen.
Michel Devine
ps
The Unix f77 compiler under 4.2 BSD accepts '#' as a comment specifier,
by the way.
--
--------------------------------------------------------------------------------
mpdevine%watdaisy@waterloo.csnet (519) 884-7123 Michel P. Devine
mpdevine%watdaisy%waterloo.csnet@csnet-relay.arpa CS Dept., U. Waterloo
{allegra,decvax,inhp4,utzoo}!watmath!watdaisy!mpdevine Waterloo, Ont. N2L3G1