Recent public codes are listed below. You can filter them by the following programming languages:
- view
- All
- Ada
- Assembler
- Assembler
- AWK (gawk)
- AWK (mawk)
- Bash
- bc
- Brainf**k
- C
- C#
- C++
- C++0x
- C99 strict
- CLIPS
- Clojure
- COBOL
- COBOL 85
- Common Lisp (clisp)
- D (dmd)
- Erlang
- F#
- Factor
- Falcon
- Forth
- Fortran
- Go
- Groovy
- Haskell
- Icon
- Intercal
- Java
- JavaScript (rhino)
- JavaScript (spidermonkey)
- Lua
- Nemerle
- Nice
- Nimrod
- Objective-C
- Ocaml
- Oz
- Pascal (fpc)
- Pascal (gpc)
- Perl
- Perl 6
- PHP
- Pike
- Prolog (gnu)
- Prolog (swi)
- Python
- Python 3
- R
- Ruby
- Scala
- Scheme (guile)
- Smalltalk
- SQL
- Tcl
- Text
- Unlambda
- VB.NET
- Whitespace
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs where
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs where
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d' > as * 4 = d4 xs' | otherwise = xs where d = maximumBy (compare `on` (abs . ((average xs -)))) xs xs' = delete d xs ave' = average xs'
...
-
1 2 3 4 5 6 7 8 9
import Control.Applicative ((<$>)) import qualified Data.ByteString.Lazy.Char8 as LazyBS import System.Environment (getArgs) import qualified System.IO as SI main :: IO () main = do fp <- getArgs case fp of
...
-
1 2 3 4 5 6 7 8
printAns :: Integer -> Integer -> IO() printAns tc s = putStrLn $ ("Case #" ++ (show tc) ++ ": " ++ (show s)) -- "HACKERUP"としたのはCを2回数える必要はないから. f a=foldr min 999$map(\x->if fst x=='C'then snd x`div`2 else snd x)$zip"HACKERUP"$map(\c->sum$map(\x->if x==c then 1 else 0)a)"HACKERUP" solveTC :: Integer -> Integer -> IO () solveTC 0 _ = return ()
-
1 2 3
length2' :: (Num b) => [a] -> b length2' [] = 0 length2' (x:xs) = 1 + length2' xs
-
1 2 3 4 5 6 7
head' :: [a] -> a head' (x:_) = x -- Pattern match(es) are non-exhaustive In an equation for `head'': Patterns not matched: [] length2' :: (Num b) => [a] -> b length2' [] = 0 --Pattern match(es) are non-exhaustive In an equation for `length2'': Patterns not matched: _ : (_ : _) length2' [x] = 1 + (length2' (tail [x]))
-
1 2 3 4 5 6 7 8 9
main = do putStrLn $ show $ alpha 20 fact 0 = 1 fact n = n * fact (n - 1) alpha 1 = 7 alpha 2 = 2 alpha 3 = 1 alpha n = fact (n + 1) * alpha(n - 1) +
...
-
1 2 3 4 5 6 7 8
-- least common multipliers import List lcm2 a b | a == b = a | b == 1 = a | a == 1 = b | otherwise = y where (Just y) = find (\x -> mod x b == 0) (map (*a) [1..b])
...
-
1 2 3 4 5
fib = [1, 1] ++ (zipWith (+) fib (tail fib)) fibBoundEven = [x | x <- takeWhile (<= 4000000) fib, (mod x 2 == 0)] main = do print (sum fibBoundEven)
-
1 2 3 4
main = do putStrLn "Sum all natural numbers from 1 to? " integerInput <- readLn (print . sum ) [1..integerInput]
-
1 2 3 4
main = do putStrLn "Sum all natural numbers from 1 to? " integerInput <- readLn (print . sum ) [1..integerInput]
-
1 2 3 4
main = do putStrLn "Sum all natural numbers from 1 to? " integerInput <- readLn print $ integerInput * 2
-
1 2 3 4
main = do putStrLn "Sum all natural numbers from 1 to? " integerInput <- getLine print $ read integerInput * 2
-
1 2 3 4 5
main = do putStrLn "Sum all natural numbers from 1 to? " integerInput <- getLine putStrLn (show (sum ([1..(read integerInput)])))
-
1 2 3 4 5
main = do putStrLn "Sum all natural numbers from 1 to? " integerInput <- getLine putStrLn (show (sum ([1..(read integerInput)])))
-
1 2 3 4
main = do putStrLn "Sum all natural numbers from 1 to? " integerInput <- getLine putStrLn (show ((read integerInput) * 2))
-
1 2
integerInput <- getLine putStrLn (read integerInput)
-
1 2 3 4 5 6 7 8 9
balance :: String -> Bool balance = null . foldl' check [] where check [] x | x `elem` "([)]" = [x] | otherwise = [] check s@(y:ys) x | x `elem` "([" = x:s | y `match` x = ys | otherwise = s match '(' ')' = True match '[' ']' = True
...
-
1 2 3 4 5 6 7 8 9
module Main where factorial n = if n == 0 then 1 else n * factorial (n - 1) main = do putStrLn "What is 5! ?" x <- readLn if x == factorial 5 then putStrLn "You're right!" else putStrLn "You're wrong!"
-
1 2 3
--fibs = 0 : 1 : zipWith (+) fibs (tail fibs) --take 3 [5,4,3,2,1] main = putStrLn (take 3 [5,4,3,2,1])
-
1 2 3 4 5
--fibs = 0 : 1 : zipWith (+) fibs (tail fibs) take 3 [5,4,3,2,1] main = putStrLn (take 3 [5,4,3,2,1])


