Advertisement
CosmicFox33

Untitled

Jan 29th, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int c;
  5. void f(int n){
  6.     if(n>35) return;
  7.     if(n==35) c++;
  8.     f(n+3);
  9.     f(n+2);
  10.     f(n+5);
  11. }
  12.  
  13. int main()
  14. {
  15.     f(20);
  16.     cout << c;
  17.     return 0;
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement