Hello world !

2003 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2004 | 01 | 02 | 03 | 04 | 05 | 07 | 08 | 09 | 12 |
2005 | 02 | 05 |
2006 | 09 |
2007 | 05 | 08 |
2008 | 05 | 10 |
2009 | 07 |

2003-06-30 HelloWorld / Scheme

[][]

 (display "Hello world")
 (newline)

[] range

 (define (range a b)
   (if (< a b)
     '()
     (append (list a) (range (+ a 1) b))))

[] units count

 units = [1, 5, 10, 50, 100, 500, 1000, 2000, 5000, 10000]

 def cnt(units, amount):
   if len(units) == 1:
     print "%10d : %d\n" % ( units[0], int(amount / units[0]) )
     return amount % units[0]
   else:
     return cnt(units[:1], cnt(units[1:], amount))

 if __name__ == '__main__':
   from sys import argv
   try :
     cnt(units, argv[1])
   except:
     print "input valid value"

2003-06-29 Helloworld / C++

[][]

#include <iostream>
using namespace std;

int main(void){
  cout << "Hello, world" << endl;
  return 0;
}

[] reference

 # let num = ref 0;;
 val num : ref int = 0

 # !num;;
 - : ref int = 0

 # num := 10;;
 - : unit()

 # !num;;
 - : ref int = 10

2003-06-28 Helloworld / Java

[][]

class HelloWorld{
  public static void main(String[] argv){
    System.out.println("Hello world");
  }
}

2003-06-27 Helloworld / Ocaml

[][]

print_string "Hello world\n";;

[] Ocaml

let 'a btree = Empty | Node of 'a * 'a btree * 'a btree;;

let rec member x btree = 
  match btree with
    Empty -> false
  | Node(y, left, right) ->
      if x = y then true else
      if x < y then member x left else member x right;;

let rec insert x btree =
  match btree with
    Enpty -> Node(x, Empty, Empty)
  | Node(y, left, right) ->
      if x <= y then Node(y, insert x left, right)
                else Node(y, left, insert right);;

2003-06-26 Helloworld / python

[][]

#!/usr/bin/python

if __name__ == '__main__':
    print "Hello, world"

メイン関数はなくてもいいけど、

もし書くとしたら、以下の記事を参照。

2003-06-25 HelloWorld / ruby

[][]

#!/usr/bin/ruby
puts "Hello world";

2003-06-24 HelloWorld / Perl

[][]

#!/usr/bin/perl
print "Hello world\n";

[]

agile開発とオープンソース・ムーブメントについて。

2003-06-23 Hello world !!

[][]

一日一個 hello world プログラムを、

いろんなプログラミング言語で実装してみる。いつまで続くかなぁ。

#include <stdio.h>
#include <stdlib.h>
 
int main(void){
 puts("Hello world");
 return EXIT_SUCCESS;
}

teamiklteamikl 2003/06/24 21:59 printf(”%s¥n”, ”Hello world”);