Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() //2zad
  6. {
  7. int suma=0,lb,x;
  8. cout << "Ile liczb mam ssumowac?" << endl;
  9. cin >> x;
  10. while (x>0)
  11. {
  12. cout <<"podaj liczbe: "<<endl;
  13. cin>> lb;
  14. suma=suma+lb;
  15. x--;
  16. }
  17. cout <<"wynik to: "<<suma;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement