Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int maybe(int N)
- {
- if ( N < 0)
- return 0;
- else if ( N == 1)
- return 1;
- else
- return ((maybe( N-3)) || (maybe( N-5)));
- }
- int main()
- {
- int N;
- cin >> N;
- if (maybe(N)==1)
- cout << "YES";
- else
- cout << " NO";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement