Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- isPrim::Int->Int->Int
- isPrim x y
- | x == y = 1
- | (x `mod` y) == 0 = 0
- | otherwise = (isPrim x (y+1))
- qnt::String->Int->Int
- qnt s t
- | t == (length s) = (isPrim (read s::Int) 1)
- | otherwise = (isPrim (read s::Int) 1) + (qnt s (t+1))
- percorre::String->Int
- percorre (f:r) = (qnt r 0) + (percorre r)
- main::IO()
- main = do
- pal <- getLine
- putStrLn( show((percorre pal) + (percorre (reverse pal))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement