Advertisement
Guest User

Untitled

a guest
May 27th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. -module(zad2).
  2. -export([left_rotation/1]).
  3.  
  4. left_rotation({node, K1, V1, L1, {node, K2, V2, L2, R2}}) ->
  5. {node, K2, V2, {node, K1, V1, L1, L2}, R2};
  6. left_rotation(_) ->
  7. error.
  8.  
  9.  
  10. -module(zad1).
  11. -export([pitagorean/2]).
  12. pitagorean(N) ->
  13. [{A,B,C} ||
  14. A <- lists:seq(1, (N div 3)),
  15. B <- lists:seq(A + 1, (N div 2) -1),
  16. C <- [N-A-B],
  17. C*C == A*A + B*B].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement