Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1.  
  2. namespace bool_CzySasiaduje_int_a__int_b_
  3. {
  4. class Program
  5. {
  6. static bool CzySasiaduje(int a, int b)
  7. {
  8. if (a < b)
  9. {
  10. if (a % 3 == 0 && ((a+1)%5==0)||(a%5==0 && (a+1)%3==0))
  11. {
  12. return true;
  13. }
  14. return CzySasiaduje(a + 1, b);
  15. }
  16. else if (a==b)
  17. {
  18. return false;
  19. }
  20. else
  21. {
  22. if ((b % 3 == 0 &&(b+1)%5==0)||(b%5==0 && (b+1)%3==0))
  23. {
  24. return true;
  25. }
  26. return CzySasiaduje(a, b + 1);
  27. }
  28.  
  29. }
  30. static void Main(string[] args)
  31. {
  32.  
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement