fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. float at = RecursiveMet(7000, 0, 0, 2);
  8. Console.WriteLine(at);
  9.  
  10. }
  11.  
  12. public static float RecursiveMet(float salary, float prevY, int curI, int doI)
  13. {
  14. if (curI == doI)
  15. {
  16. return prevY;
  17. }
  18.  
  19. curI++;
  20. float newY = prevY + salary*12 + ((prevY+salary*12) / 10);
  21.  
  22. return RecursiveMet(salary, newY, curI, doI);
  23. }
  24. }
  25.  
Success #stdin #stdout 0.05s 30160KB
stdin
Standard input is empty
stdout
194040