Skip to content

Instantly share code, notes, and snippets.

View kira924age's full-sized avatar

Akira Kunishige kira924age

View GitHub Profile
@kira924age
kira924age / typing_cui_01.c
Last active August 29, 2015 14:01
簡単なタイピングゲーム
#include <time.h>
#include <conio.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#define Qnumber 20
int main(){
@kira924age
kira924age / caesar.c
Last active August 29, 2015 14:01
Just rot Alphabet.
#include <stdio.h>
#define key 13
int main()
{
char c;
while(scanf("%c",&c) != EOF){
if('A' <= c && c <= 'Z' ){
if((c+key) > 'Z')
c += (key%26-26);
@kira924age
kira924age / bin2hex.py
Created August 28, 2014 17:01
2進数文字列を16進数文字列に変換する。(format(int(hoge, 2), 'x')が使えないとき用)
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
argv = sys.argv
argc = len(argv)
if argc != 2:
print 'Usage: python bin2hex.py [file_name]'
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from PIL import Image
gif0 = Image.open('fuga-0.gif')
gif1 = Image.open('fuga-1.gif')
gif2 = Image.open('fuga-2.gif')
gif3 = Image.open('fuga-3.gif')
gif4 = Image.open('fuga-4.gif')
@kira924age
kira924age / SECCON_WARS_2015.md
Last active December 25, 2015 14:22
This is a solution of SECCON WARS 2015.

When I converted mp4 to gif, I cutted from 00:25 to 01:05 in the movie.

Size of gif is widh:600, weigh:437, and frame rate is 2 frames per seccond.

  • Finally, run wars_solver_ver2.py, and scan flag.png as a QR code.
@kira924age
kira924age / case1.c
Last active December 26, 2015 23:59
ファイルの入出力の場合
#include <stdioh.h>
#include <stdlib.h>
int main()
{
FILE *infile, *outfile;
int L, a, b, c, d;
int M, N;
infile = fopen("in1.txt","r");
@kira924age
kira924age / case2.c
Last active December 27, 2015 00:08
標準入出力の場合
#include <stdio.h>
int main()
{
int L, a, b, c, d;
int M, N;
scanf("%d\n%d\n%d\n%d\n%d\n",&L, &a, &b, &c, &d);
M = a/c;
N = b/d;
if(a % c != 0)
@kira924age
kira924age / gojoho.c
Last active January 2, 2016 06:39
拡張版ユークリッドの互除法 84x + 11y = 1 (y > 0)
#include <stdio.h>
int main()
{
int L = 84, e = 11;
int x, x2, y, y2, z, z2, q;
int tmp;
x = 1;
y = 0;
@kira924age
kira924age / ARC022_B.c
Last active January 2, 2016 07:34
尺取法
/*http://arc022.contest.atcoder.jp/tasks/arc022_2*/
#include <stdio.h>
#define max(a, b) ((a > b) ? a : b)
int main(){
int N, A[100001], S[100001]={0};
int ans=0, r=0, l;
scanf("%d", &N);
@kira924age
kira924age / pointer.c
Last active October 15, 2017 21:46
ポインタのお勉強
#include <stdio.h>
#include <string.h>
void *test(char *s) {
int i;
for (i = 0; i < strlen(s); i++) {
// ポインタが指す値を表示する3通りの方法
printf("%c\n", s[i]);
printf("%c\n", *(&s[0] + i));