首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

if、函数、递归 老是报错!该如何解决

2012-09-10 
if、函数、递归 老是报错!!!Delphi(Pascal) codefunction func(x:integer):integerbeginif(x0) thenresult

if、函数、递归 老是报错!!!

Delphi(Pascal) code
function func(x:integer):integer;begin     if(x=0) then          result 0     else          result x*func(x-1);end;

错在哪了呢?

[解决办法]
首先是语法错误 result 0 应为result:=0,依此类推。

热点排行