Advertisement
tinyevil

Untitled

Aug 6th, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. switch ( x ){
  2. case 0:
  3.     do_something();
  4. case 1:
  5.     do_something();
  6. case 2:
  7.     do_something();
  8. }
  9.  
  10.  
  11. switch ( x, y ){
  12. case Zero, Zero:
  13.     return Zero;
  14. case Zero, Succ(n):
  15.     return n;
  16. case Succ(n), Zero:
  17.     return n;
  18. case Succ(n), Succ(m):
  19.     return Succ(Succ(add(n, m)));
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement