This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define RAMSIZE 30000 | |
int main(int argc, char **argv) | |
{ | |
FILE *f; /* インストラクションポインタ */ | |
int *p; /* データポインタ */ | |
int b[RAMSIZE] = { 0 }; /* バッファ */ | |
char c; /* 文字 */ | |
int i; /* カウンタ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# coding: utf-8 | |
function compress_hash() | |
{ | |
echo $2 | sed \ | |
-e 's/aaa*/A/g' \ | |
-e 's/abb*/B/g' \ | |
-e 's/acc*/C/g' \ | |
-e 's/add*/D/g' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
char c[80];int v[25];int G(char*p){char*q=p;int n=(int)strtol(p,&p,0);return q- | |
p?n:v[*p++-65];}int E(char*p){int n=G(p);for(;*p;){char o=*p++;int m=G(p);if(o | |
==43)n+=m;if(o==45)n-=m;if(o==42)n*=m;if(o==47)n/=m;if(o==60)n=n<=m;if(o==61)n= | |
n==m;if(o==62)n=n>=m;}return n;}P(){printf("OK\n* ");}int main(){P();for(;gets( | |
c);){c[1]-61||*c-63?v[*c-65]=E(c+2):printf("%d\n",E(c+2));P();}return 0;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
char c[80]; | |
int v['Z'-'A'] = {0}; | |
// 数値・値を解釈して取得 | |
int getval(char* p) | |
{ | |
char* q = p; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# coding: utf-8 | |
def get_score file1,file2 | |
def pattern path | |
f = 16 | |
tmp = '/tmp/imgmatch.xbm' | |
`convert -level 0%,75%,0.8 -fuzz 50% -trim -resize #{f}x#{f}! #{path} #{tmp}` | |
ptn = File.open(tmp).read.scan(/0x[\dA-F]{2}/).map{|n| n.hex.to_s(2).rjust(8, '0')}.join.split(//) | |
File.delete tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UEsDBBQAAAAIAJ1acUU2Njnh8hEAAAAmAAALABwAZGlzcGxheS5leGVVVAkAA4pbaVSKXiNVdXgL | |
AAEE6AMAAAToAwAA7Vl9cFzVdT/37e7bp5W0eCUsWfhrLcmwtqS1JNv4G0uy/CGwsSLJsoVJnbe7 | |
T/LDu+8t7721LTsGESZtnA4fbktbCJ06KZmO+wXMkEACaSHppKQzZkhSOpA0DHSafgBT2oRmhoTB | |
/Z373q5Wllr4N5k86Z17zrnnnnvuueeee+/bA7c9SCEiCuO9coXoGfKfPvroZwZvfOXX4/RUzeVV | |
z4j9l1eNHTfdZNGxpxy9kMzqlmV7yYyRdEpW0rSSgwdHkwU7Z6Tr62PtgY7h3UT7RYg+f9QcK+t9 | |
gxRRKzSiZSA0n3frNoBk2bA+H1d8u4lmS2mU4qMh6vss0SL5P1tWCvm8t5XocKCyO7LAID9FVIfi | |
0a2+OR/7SVZMl48Gel8VnfaM0x7KsaXBuJbN2l2l4lNpx3WyFNgGG0nFu2KuHNh9acfI21nfVrZZ | |
6mqfJzdwtZnd2/xyn2wSodQNRF4jkQCdQG/PrCYqio8zYP9p7A7TSyTbJ5QUPB1TQivWhVZ0iNA5 | |
DCGshJu6Q80dInxOZSqypCcSWbmoJ7S0Q0TORZkVD58Lc5mqQfeKcpZbLTuinOXK25SzajXpwsRY | |
qoF7UVKwOhZroNS1TEqqtkGkFqN0mwDOcbQobjOjGqNnGa6M2UtYXhLKhyqEVLcFHPu6CtvGHMXW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
#define COL 64 | |
#define ROW 24 | |
FILE* f; | |
/* 画面を白く塗りつぶす */ | |
void clear() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int fib(int k) | |
{ | |
if (k == 0) | |
return 0; | |
else if (k == 1) | |
return 1; | |
else if (k >= 2) { | |
return fib(k-2) + fib(k-1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
void heavy_function() | |
{ | |
sleep(5); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
// #include <string.h> | |
#ifndef _STRING_H | |
int strlen(const char* s) | |
{ | |
int i = 0; | |
while (s[++i]) | |
; |
OlderNewer