fork download
  1. let nombreDePesees n =
  2. let restant = ref n in
  3.  
  4. while ( !restant > 3) do
  5. print_int !restant;
  6. if !restant - (!restant/3)*3 = 2 then restant:= !restant - ((!restant/3)*2)-1
  7. else restant:= !restant - ((!restant/3)*2)
  8. ;
  9. done;
  10. print_int !restant;
  11. ;;
  12.  
  13. let _ =
  14. let n = read_int () in
  15.  
  16. nombreDePesees n;
Success #stdin #stdout 0s 2780KB
stdin
Standard input is empty
stdout
Standard output is empty