Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(test).
- -export([list_diviseur/1]).
- list_diviseur(A) ->
- list_diviseur(A, 1).
- list_diviseur(A, B) ->
- case A rem B of
- 0 ->
- io:format("==> ~p x ~p ~n", [B, trunc(A/B)]);
- _ ->
- next
- end,
- case math:sqrt(A) < B of
- true ->
- ok;
- false ->
- list_diviseur(A, B+1)
- end.
Add Comment
Please, Sign In to add comment