跳转到内容

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 档案,存勒互联网档案馆当中。(2008年12月6号) project main page