From cacf6b0e444faaba49f27b0f8e5a92f5dd9980ae Mon Sep 17 00:00:00 2001 From: programarivm Date: Thu, 26 Sep 2019 10:43:20 +0100 Subject: [PATCH] FactorialByValue.m is been shortened --- 02-user-defined-functions/FactorialByValue.m | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/02-user-defined-functions/FactorialByValue.m b/02-user-defined-functions/FactorialByValue.m index b932a47..0f75f97 100644 --- a/02-user-defined-functions/FactorialByValue.m +++ b/02-user-defined-functions/FactorialByValue.m @@ -1,11 +1,11 @@ - read "Enter n: ",n,! - set result=$$factorial(n) - write n,"! = ",result,! - halt + r "Enter n: ",n,! + s result=$$factorial(n) + w n,"! = ",result,! + h factorial(n) - if n=1 quit 1 - set k=1 - for i=1:1:n do - . set k=k*i - quit k + i n=1 q 1 + s k=1 + f i=1:1:n d + . s k=k*i + q k