Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int tong;
  14. tong = boi3(3);
  15. tong += boi5(5);
  16. System.Console.WriteLine(tong);
  17. System.Console.ReadLine();
  18.  
  19. }
  20. public static int boi3(int temp)
  21. {
  22. if (temp < 1000)
  23. {
  24. return temp + boi3(temp + 3);
  25. }
  26. else
  27. return 0;
  28. }
  29. public static int boi5(int temp)
  30. {
  31. if (temp < 1000)
  32. {
  33. if (temp % 3 == 0)
  34. return boi5(temp + 5);
  35. else
  36. return temp + boi5(temp + 5);
  37. }
  38. else
  39. return 0;
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement