Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- for(int i = 1; i <= n; i++){ // 1 2 ... n
- cout << i << " ";
- }
- cout << '\n';
- for(int i = n; i >= 1; i--){ // n n-1 ... 1
- cout << i << " ";
- }
- cout << '\n';
- for(int i = 1; i <= n; i *= 2){ // 1 2 4 ...
- cout << i << " ";
- }
- cout << '\n';
- int a , b;
- cin >> a >> b;
- for(int i = a; i <= b; i++){ // a a+1 .. b-1 b
- cout << i << " ";
- }
- cout << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement