Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. setlocale(LC_ALL, "ru");
  6. int x,sum=0;
  7. do {
  8. cout << "Введите числа: " << endl;
  9. cin >> x;
  10. if (x > 0) {
  11. sum += x;
  12. }
  13. } while (x > 0 || x < 0);
  14. cout << "Сумма положительных чисел= " << sum << endl;
  15.  
  16. system("pause");
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement