Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- int x;
- int a;
- cin>>n;
- cin>>x;
- a=2n+1;
- int b[a];
- b[n]=x;
- for (int i =n-1; i > -1; i--) {
- b[i]=b[i+1]-1;
- }
- for (int i=n+1; i < a; i++){
- b[i]=b[i-1]-1;
- }
- for (int i = 0; i < a; i++) {
- cout << b[i] <<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement