Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace bool_CzySasiaduje_int_a__int_b_
- {
- class Program
- {
- static bool CzySasiaduje(int a, int b)
- {
- if (a < b)
- {
- if (a % 3 == 0 && ((a+1)%5==0)||(a%5==0 && (a+1)%3==0))
- {
- return true;
- }
- return CzySasiaduje(a + 1, b);
- }
- else if (a==b)
- {
- return false;
- }
- else
- {
- if ((b % 3 == 0 &&(b+1)%5==0)||(b%5==0 && (b+1)%3==0))
- {
- return true;
- }
- return CzySasiaduje(a, b + 1);
- }
- }
- static void Main(string[] args)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement