programming challenge (silly)

Kjell Post kjell at saturn.ucsc.edu
Tue Mar 7 23:21:00 AEST 1989


In article <3115 at homxb.ATT.COM> cjn at homxb.ATT.COM (C.NORTHRUP) writes:
>
>------------------------------------------
>
>Kevin Meier from AT&T Bell Labs completed this in approx 15 minutes using
>only 96 characters.  I will submit his solution in a couple of days.
>Gives others a chance....

I have 91 now but am not sure about portability of main(n,m) and printf.

main(n,m){scanf("%d\n",&m);while(m>1&m<10)n*=m--;
printf(m-1?"error\n":"answer is %d\n",n);}

-- 
      For athletes and programmers,  ! Kjell E. Post
a woman is the end of their career.  ! CIS/CE
                                     ! University of California, Santa Cruz
              -- A.Wickberg          ! Email: kjell at saturn.ucsc.edu



More information about the Comp.lang.c mailing list