From 59698d61ab48784d33798a7c8a32daee17940380 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Mon, 19 Apr 2021 09:40:40 -0500 Subject: Create test.hs --- test.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test.hs diff --git a/test.hs b/test.hs new file mode 100644 index 0000000..c202f35 --- /dev/null +++ b/test.hs @@ -0,0 +1,10 @@ +-- Haskell + +gcd :: Integer -> Integer -> Integer +gcd a b = if b > 0 then gcd b (mod a b) else a + +main = do + putStrLn "test" + let n = 1000 + let a = [0..n-1] + print $ foldl (+) 0 (map (\i -> foldl (+) 0 (map (`gcd` i) a)) a) -- cgit v1.2.3-70-g09d2