Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- //всички четни степени от 0 до n (0, 2, 4, 6, 8,..., n)
- //for цикъл за степените
- //повтарям: отпечатвам 2 на дадена степен
- //начало: 0
- //край: n
- //промяна: +2
- for (int power = 0; power <= n; power += 2)
- {
- cout << pow(2, power) << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement