diff --git a/alan/programs/factors.alan b/alan/programs/factors.alan index d026ec6..802a0f7 100644 --- a/alan/programs/factors.alan +++ b/alan/programs/factors.alan @@ -4,7 +4,7 @@ main() : proc flag : int; { - writeString("Enter value of N > "); + writeString("Please, give me a positive integer: "); n = readInteger(); lcv = 2; flag = 1; while (lcv <= (n / 2)) diff --git a/alan/programs/factors.input b/alan/programs/factors.input new file mode 100644 index 0000000..d64f0da --- /dev/null +++ b/alan/programs/factors.input @@ -0,0 +1 @@ +37483783 diff --git a/alan/programs/factors.result b/alan/programs/factors.result new file mode 100644 index 0000000..aeb8041 --- /dev/null +++ b/alan/programs/factors.result @@ -0,0 +1,3 @@ +Please, give me a positive integer: The non-trivial factors of 37483783 are: +293 +127931 diff --git a/alan/programs/gcd.alan b/alan/programs/gcd.alan index be638ad..2389c36 100644 --- a/alan/programs/gcd.alan +++ b/alan/programs/gcd.alan @@ -21,10 +21,10 @@ gcd():proc b:int; { - writeString("Give the first integer: "); - a=readInteger(); - writeString("Give the second integer: "); - b=readInteger(); - writeString("\nThe gcd you are looking for is "); + writeString("Give me two positive integers: \n"); + a = readInteger(); + b = readInteger(); + writeString("\nTheir GCD is: "); writeInteger(find_gcd(a, b)); + writeString("\n"); } diff --git a/alan/programs/gcd.input b/alan/programs/gcd.input new file mode 100644 index 0000000..ec26dbe --- /dev/null +++ b/alan/programs/gcd.input @@ -0,0 +1,2 @@ +123456789 +666 diff --git a/alan/programs/gcd.result b/alan/programs/gcd.result new file mode 100644 index 0000000..e6a48a8 --- /dev/null +++ b/alan/programs/gcd.result @@ -0,0 +1,3 @@ +Give me two positive integers: + +Their GCD is: 9