SHARE
TWEET

gay code

a guest Feb 26th, 2020 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int n;
  7.     int x;
  8.     int a;
  9.    cin>>n;
  10.    cin>>x;
  11.    a=2n+1;
  12.    int b[a];
  13.  
  14.    b[n]=x;
  15.    for (int i =n-1; i > -1; i--) {
  16.        b[i]=b[i+1]-1;
  17.    }
  18.    for (int i=n+1; i < a; i++){
  19.        b[i]=b[i-1]-1;
  20.    }
  21.    for (int i = 0; i < a; i++) {
  22.       cout << b[i] <<endl;
  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