fork download
  1. int times(int n, function block) {
  2. for (int i = 0; i < n; i++)
  3. block();
  4. return n;
  5. }
  6.  
  7. int main() {
  8. int x = 0;
  9. times(3) {
  10. write("Hello world! <%d>\n", x++);
  11. } ;
  12. // => Hello world! <0>
  13. // => Hello world! <1>
  14. // => Hello world! <2>
  15. return 0;
  16. }
Success #stdin #stdout 0.03s 6608KB
stdin
Standard input is empty
stdout
Hello world! <0>
Hello world! <1>
Hello world! <2>