Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int wynik = 0;
- int potega = 1;
- int licznik = 0;
- /*do
- {
- wynik += potega;
- ++licznik;
- potega *= 2;
- } while(licznik < 10);*/
- /*for(licznik = 0; licznik < 10; ++licznik)
- {
- wynik += potega;
- potega *= 2;
- }*/
- while(licznik < 10)
- {
- wynik += potega; // wynik = wynik + potega;
- ++licznik;
- potega *= 2; // potega = potega * 2;
- }
- cout << wynik << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement