Facebook
From Small Coyote, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 185
  1. let get_sum_iter n =
  2.   let aux = n ref in
  3.   let sum = ref in
  4.   ( while(aux) do
  5.       sum := !sum + !aux mod 10;
  6.       aux := !aux / 10
  7.     done;
  8.    !aux );;