diff options
author | Anthony Wang | 2021-04-19 09:40:40 -0500 |
---|---|---|
committer | GitHub | 2021-04-19 09:40:40 -0500 |
commit | 59698d61ab48784d33798a7c8a32daee17940380 (patch) | |
tree | b5ceb092f0eef741141d6b0097770def9799a373 | |
parent | 8baf3ceec51bb0f9dc52c8a2224698367c84f1e1 (diff) |
Create test.hs
-rw-r--r-- | test.hs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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) |