Language: C++

# -*- coding: utf-8 -*-
EPS = 1e-9

class Point
  attr_reader :x, :y
  def initialize(x, y=nil)
    @x, @y = x, y if y
    @x, @y = x[0], x[1] unless y
  end
  def +(other)
    Point.new(@x + other.x, @y + other.y)
  end
  def -(other)
    Point.new(@x - other.x, @y - other.y)
  end
  def *(other)
    Point.new(@x * other, @y * other)
  end
end

class Line
  attr_reader :s, :t
  def initialize(s, t=nil)
    @s, @t = s, t if t
    @s, @t = Point.new(s[0..1]), Point.new(s[2..3]) unless t
  end
end

def dot(a, b); a.x * b.x + a.y * b.y; end
def cross(a, b);  a.x * b.y - b.x * a.y; end

def is_intersected_ls(a, b)
  cross(a.t - a.s, b.s - a.s) * cross(a.t - a.s, b.t - a.s) < EPS and
    cross(b.t - b.s, a.s - b.s) * cross(b.t - b.s, a.t - b.s) < EPS
end

def intersection_ls(a, b)
  tmp = b.t - b.s

  d1 = cross(tmp, a.s - b.s).abs
  d2 = cross(tmp, a.t - b.s).abs
  t = d1 / (d1 + d2)

  a.s + (a.t - a.s) * t
end

def area(points)
  cross(points[0] - points[2], points[1] - points[2]).abs / 2
end

def fortune(x)
  case x
  when 0; "kyo"
  when 0..100000; "syo-kichi"
  when 0..1000000; "kichi"
  when 0..1900000; "chu-kichi"
  else; "dai-kichi"
  end
end

while input = gets.split.map(&:to_i) and input.count(0) != 4
  l = [ Line.new(input) ]
  2.times{ l << Line.new(gets.split.map(&:to_i)) }

  res = nil
  points = []
  for i in 0..2
    res = "kyo" unless is_intersected_ls(l[i], l[(i + 1) % 3])

    points << intersection_ls(l[i], l[(i + 1) % 3]) unless res
  end

  res = fortune(area(points)) unless res

  puts res
end

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:7:5: error: stray '@' in program
    7 |     @x, @y = x, y if y
      |     ^
a.cc:7:9: error: stray '@' in program
    7 |     @x, @y = x, y if y
      |         ^
a.cc:8:5: error: stray '@' in program
    8 |     @x, @y = x[0], x[1] unless y
      |     ^
a.cc:8:9: error: stray '@' in program
    8 |     @x, @y = x[0], x[1] unless y
      |         ^
a.cc:11:15: error: stray '@' in program
   11 |     Point.new(@x + other.x, @y + other.y)
      |               ^
a.cc:11:29: error: stray '@' in program
   11 |     Point.new(@x + other.x, @y + other.y)
      |                             ^
a.cc:14:15: error: stray '@' in program
   14 |     Point.new(@x - other.x, @y - other.y)
      |               ^
a.cc:14:29: error: stray '@' in program
   14 |     Point.new(@x - other.x, @y - other.y)
      |                             ^
a.cc:17:15: error: stray '@' in program
   17 |     Point.new(@x * other, @y * other)
      |               ^
a.cc:17:27: error: stray '@' in program
   17 |     Point.new(@x * other, @y * other)
      |                           ^
a.cc:24:5: error: stray '@' in program
   24 |     @s, @t = s, t if t
      |     ^
a.cc:24:9: error: stray '@' in program
   24 |     @s, @t = s, t if t
      |         ^
a.cc:25:5: error: stray '@' in program
   25 |     @s, @t = Point.new(s[0..1]), Point.new(s[2..3]) unless t
      |     ^
a.cc:25:9: error: stray '@' in program
   25 |     @s, @t = Point.new(s[0..1]), Point.new(s[2..3]) unless t
      |         ^
a.cc:25:26: error: too many decimal points in number
   25 |     @s, @t = Point.new(s[0..1]), Point.new(s[2..3]) unless t
      |                          ^~~~
a.cc:25:46: error: too many decimal points in number
   25 |     @s, @t = Point.new(s[0..1]), Point.new(s[2..3]) unless t
      |                                              ^~~~
a.cc:54:8: error: too many decimal points in number
   54 |   when 0..100000; "syo-kichi"
      |        ^~~~~~~~~
a.cc:55:8: error: too many decimal points in number
   55 |   when 0..1000000; "kichi"
      |        ^~~~~~~~~~
a.cc:56:8: error: too many decimal points in number
   56 |   when 0..1900000; "chu-kichi"
      |        ^~~~~~~~~~
a.cc:67:12: error: too many decimal points in number
   67 |   for i in 0..2
      |            ^~~~
a.cc:2:1: error: 'EPS' does not name a type
    2 | EPS = 1e-9
      | ^~~
a.cc:29:16: error: 'a' does not name a type
   29 | def dot(a, b); a.x * b.x + a.y * b.y; end
      |                ^
a.cc:29:39: error: 'end' does not name a type
   29 | def dot(a, b); a.x * b.x + a.y * b.y; end
      |                                       ^~~
a.cc:30:19: error: 'a' does not name a type
   30 | def cross(a, b);  a.x * b.y - b.x * a.y; end
      |                   ^
a.cc:30:42: error: 'end' does not name a type
   30 | def cross(a, b);  a.x * b.y - b.x * a.y; end
      |                                          ^~~
a.cc:53:11: error: expected unqualified-id before string constant
   53 |   when 0; "kyo"
      |           ^~~~~
a.cc:54:19: error: expected unqualified-id before string constant
   54 |   when 0..100000; "syo-kichi"
      |                   ^~~~~~~~~~~
a.cc:55:20: error: expected unqualified-id before string constant
   55 |   when 0..1000000; "kichi"
      |                    ^~~~~~~
a.cc:56:20: error: expected unqualified-id before string constant
   56 |   when 0..1900000; "chu-kichi"
      |                    ^~~~~~~~~~~
a.cc:57:9: error: expected unqualified-id before string constant
   57 |   else; "dai-kichi"
      |         ^~~~~~~~~~~
a.cc:65:3: error: 'res' does not name a type
   65 |   res = nil
      |   ^~~