int fact(int x) {
  int r = 1;

  while (0 < x) {
    r = x * r;
    x = x - 1;
  }
  return r;
}

void main() {
  print fact(5);
}
