aboutsummaryrefslogtreecommitdiff
path: root/2020/01a.hs
diff options
context:
space:
mode:
authorAria <me@aria.rip>2023-01-02 21:58:56 +0000
committerAria <me@aria.rip>2023-01-02 21:58:56 +0000
commit5eb58ad076f2cd435b11b140820da224b60b73d5 (patch)
tree2a67939595fbf993ff04f69b9cd3f0aa20827d96 /2020/01a.hs
initial commit
Diffstat (limited to '2020/01a.hs')
-rw-r--r--2020/01a.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/2020/01a.hs b/2020/01a.hs
new file mode 100644
index 0000000..1c72ecc
--- /dev/null
+++ b/2020/01a.hs
@@ -0,0 +1,13 @@
+module Day1A where
+
+import System.Environment (getArgs)
+
+main :: IO ()
+main = do
+ args <- getArgs;
+ c <- readFile $ head args;
+ let ns = map read $ lines c;
+
+ print $ head [a * b | a <- ns, b <- ns, a + b == 2020];
+
+ return (); \ No newline at end of file