Skip to content

Instantly share code, notes, and snippets.

@i09158knct
i09158knct / 1_simple_hillclimb.c
Last active August 11, 2019 08:04
巡回セールスマン問題(eil51)コード例
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
float distance(int *point1, int *point2)
{
int
dx = point1[0] - point2[0],
puts "hello"

"hello\n"と出力される。

Rubyはメソッドの括弧を省略できる。上の文は

puts("hello")

と同じ

@i09158knct
i09158knct / ruby_guidance.md
Last active October 4, 2015 07:47
Rubyプログラムの実行について (文字コード関連は1.9時代の話。2.0からはデフォルトで文字コードはUTF-8であると見なされるようになったので、マジックコメントなどを書かなくても問題ない)

###Rubyプログラムの実行について

Rubyプログラムの実行は簡単。 適当にrbファイルを作って

puts "hello, world"

とでも書き込んで保存してやり、

$ ruby aaa.rb
@i09158knct
i09158knct / js.md
Last active October 3, 2015 03:38
JavaScript入門系まとめ