fork download
  1. int main() {
  2. function f = `+;
  3. write("f = `+\n");
  4. write("f(%d, %d) -> %d\n", 3, 4, f(3, 4));
  5. // => f(3, 4) -> 7
  6.  
  7. f = lambda(int x, int y) {
  8. int result = 1;
  9. for (int i = 0; i < y; i++)
  10. result *= x;
  11. return result;
  12. };
  13. write("f(%d, %d) -> %d\n", 3, 4, f(3, 4));
  14. // => f(3, 4) -> 81
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0.05s 8524KB
stdin
Standard input is empty
stdout
f = `+
f(3, 4) -> 7
f(3, 4) -> 81