Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int N = 0;
- do {
- cout << "Upisite N :D \n";
- cin >> N;
- }while( N < 0 || N > 31);
- if(N == 0) {
- cout << 1;
- return 0;
- }
- int multi = 2;
- int suma = 1;
- for(int i = 0; i < N; ++i) {
- suma *= multi;
- }
- suma -= 1;
- cout << suma;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment