Skip to content

Instantly share code, notes, and snippets.

int factorial(int n);
int main(void)
{
int a = factorial(4); // a = 4!
//
// 詳しくはfactorialを参照してもらえるとわかるが、factorial(4)は
// factorial(4)
// 4 * factorial(3)
// 4 * 3 * factorial(2)
@Nucleareal
Nucleareal / msort.cs
Created July 18, 2015 17:25
ふあすぷちゃんのをパクったマージソート
using System;
using System.Collections.Generic;
using System.Linq;
namespace Test
{
class Program
{
public static LinkedList<T> mergeList<T>(LinkedList<T> lList, LinkedList<T> rList, Comparison<T> cmp)
{
@Nucleareal
Nucleareal / qsort.cs
Created July 13, 2015 16:23
クイックソーヨ新旧比較で書こうと思ったけど両方共うまく行ってねえ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Reflection;
namespace Test
{
class Program
@Nucleareal
Nucleareal / phantomIngressIntelMap.hsp
Created December 21, 2014 11:12
幻想郷IntelMap
#include "mod_img.as"
#include "upaint.as"
#include "a2d.hsp"
#packopt name "pointCreator"
randomize
crs = 8
scx = 800
import java.io.File;
import java.io.FileInputStream;
import javax.swing.JFileChooser;
public class Program
{
public static void main(String[] args)
{
JFileChooser filer = new JFileChooser();
import Data.List
main = interact $ unwords . (map show) . sort . filter (>=0) . (map read) . words
isZoro :: Integer -> Bool
isZoro x = and $ map (== s) p where (s:p) = show x
main = do
x <- readLn
putStrLn . show $ isZoro x
data Orekyuu = Orekyuu deriving (Read)
instance Show Orekyuu where
show Orekyuu = "Lolita Complex"
main = do
putStrLn $ show Orekyuu
data AorOther = A | Other deriving (Show, Eq)
instance Read AorOther where
read x
| x == "A" = A
| otherwise = Other
toString :: AorOther -> String
toString x = " Your Input is " ++ show x
@Nucleareal
Nucleareal / noifq.cs
Created April 17, 2014 07:23
if文と三項演算子を使わずにaとbの大きい数を表示
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
namespace Test
{
class Program
{
public static void Main(string[] args)