hackerrank/SolveMeFirstFP at master · ehotinger/hackerrank · GitHub
Skip to content

Latest commit

 

History

History

Folders and files

README.md

Solve Me First FP

Solution

Haskell

main = do
    a <- readLn :: IO Int
    b <- readLn :: IO Int
    print (a + b)

Explanation

main = do

We first create a block of main program.

    a <- readLn :: IO Int
    b <- readLn :: IO Int

Then, we ask user input. Both a and b read Integer from the IO.

    print (a + b)

Last, we simply print the sum of a and b. Why we use print instead of putStrLn? Because it's a number. That's it!