]]> ]]>

Факториал в LOLCODE

Пример для версий loljs 1.1

Используется рекурсивное определение факториала.

HAI
  HOW DUZ I FACTORIAL N
    BOTH SAEM 0 AN N
    O RLY?
      YA RLY
        FOUND YR 1
      NO WAI
        FOUND YR PRODUKT OF N AN FACTORIAL DIFF OF N AN 1
    OIC
  IF U SAY SO
  
  I HAS A N ITZ 0
  IM IN YR LOOP UPPIN YR N WILE N SMALLR THAN 17
    VISIBLE SMOOSH N "! = " FACTORIAL N
  IM OUTTA YR LOOP
KTHXBYE

Комментарии

]]>

blog comments powered by Disqus

]]>

Работа программистам