Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4. int x=2, i=0;
  5. while (x<=1024){
  6. cout<<x<<"+";
  7. i=i+x;
  8. x=x*2;
  9. }
  10. cout<<"\b="<<i;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement