Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #define debug(x) cout << #x << " = " << x << endl
  3. typedef unsigned long long ULL;
  4. using namespace std;
  5. const int N=100000;
  6. string  f(int n,int m)
  7. {
  8.     if(n<=m)
  9.     {
  10.         if(n==m)
  11.         {
  12.             return to_string(n);
  13.         }
  14.         return f(n,m-1)+" "+to_string(m);
  15.     }
  16.     if(n>=m)
  17.     {
  18.        
  19.         if(m==n)
  20.         {
  21.             return to_string(m);
  22.         }
  23.         return f(n,m+1)+" "+to_string(m);
  24.     }
  25. }
  26. int a[N],n,m;
  27. int main ()
  28. {
  29. cin >> n>>m;
  30.  
  31. cout << f(n,m);
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement