Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "ru");
- int x,sum=0;
- do {
- cout << "Введите числа: " << endl;
- cin >> x;
- if (x > 0) {
- sum += x;
- }
- } while (x > 0 || x < 0);
- cout << "Сумма положительных чисел= " << sum << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement