Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int suma = 0;
  7. int numar;
  8.  
  9. do {
  10. cin >> numar;
  11. suma += numar;
  12. } while (suma < 100);
  13.  
  14. cout << suma << endl;
  15.  
  16. return 0;
  17. }
  18.  
  19.  
  20. #include <iostream>
  21.  
  22. using namespace std;
  23.  
  24. int main() {
  25. int suma = 0;
  26. int numar;
  27.  
  28. while ( suma < 100) {
  29. cin >> numar;
  30. suma += numar;
  31. }
  32.  
  33. cout << suma << endl;
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement