SHARE
TWEET

Untitled

a guest May 19th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using  namespace std;
  3.  
  4.  
  5. int maybe(int N)
  6. {
  7.   if ( N < 0)
  8.     return 0;
  9.   else if ( N == 1)
  10.     return 1;
  11.   else
  12.     return ((maybe( N-3)) || (maybe( N-5)));
  13. }
  14. int main()
  15. {
  16.   int  N;
  17.   cin >>  N;
  18.   if (maybe(N)==1)
  19.     cout << "YES";
  20.   else
  21.     cout << " NO";
  22.   return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top