Advertisement
Kacper_Michalak

Zadanie pętle 14

Dec 13th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x = 2,y=0;
  7.     int i;
  8.  
  9.     for (i = 0; i < 30; i++)
  10.     {
  11.         y += x;
  12.         x = x * 2;
  13.     }
  14.     cout << "Syn zaoszczedzil: " << y;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement