procedure method(int num); begin if num=1 then (边界条件及必要操作) else begin method(num-1); (重复的操作); end; end;