Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int positivesCount = 0, negativesCount = 0;
- int n;
- std::cout << "Вводите числа:" << std::endl;
- do
- {
- std::cin >> n;
- if (n > 0){
- ++positivesCount;
- }
- if (n < 0){
- ++negativesCount;
- }
- }
- while (n != 0);
- std::cout << "Было введено " << positivesCount << " положительных и " << negativesCount << " отрицательных чисел.";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement