fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. int count = 0;
  11.  
  12. void step() {
  13. count++;
  14. }
  15.  
  16. int tally() {
  17. int res = count;
  18. count = 0;
  19. return res;
  20. }
  21.  
  22. public static void main (String[] args) throws java.lang.Exception
  23. {
  24. Ideone q = new Ideone();
  25. // your code goes here
  26. q.functionM(5);
  27. System.out.printf("M %d\n", q.tally());
  28. }
  29.  
  30. void functionM(int n) {
  31. step();
  32. for (int i = 0; i < n; i++) {
  33. functionM(n-1);
  34. }
  35. }
  36. }
Success #stdin #stdout 0.05s 2184192KB
stdin
Standard input is empty
stdout
M 326