Cool (程序编制个言话)

来自 吴语维基百科
蹦到: 导航搜寻

Cool———是英文缩写词Classroom Object Oriented Langage

该是1996年由大仲马•艾肯Alexander Aiken)受到JavaMLPascalC++搿星程序编制言话个启发发明出来个新型言话。

要是有辰光也好好比较、比较看是是交关个。。。

程序个实例[编辑]

class Main : IO is
  Main() begin
    out_string("Enter an integer greater-than or equal-to 0: ");

    let input: Integer := in_int(); in
      if input < 0 then
        out_string("ERROR: Number must be greater-than or equal-to 0\n")
      else
        out_string("The factorial of ").out_int(input);
        out_string(" is ").out_int(factorial(input))
      fi
    end
  end;

  factorial(num: Integer): Integer := if num = 0 then 1 else num + factorial(num - 1) fi;
end;

参考文献[编辑]

外部链接[编辑]

Cool: The Classroom Object-Oriented Language project main page