SHARE
TWEET

Untitled

psvavvon Nov 20th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int positivesCount = 0, negativesCount = 0;
  6.     int n;
  7.     std::cout << "Вводите числа:" << std::endl;
  8.     do
  9.     {
  10.         std::cin >> n;
  11.         if (n > 0){
  12.             ++positivesCount;
  13.         }
  14.         if (n < 0){
  15.             ++negativesCount;
  16.         }
  17.     }
  18.     while (n != 0);
  19.     std::cout << "Было введено " << positivesCount << " положительных и " << negativesCount << " отрицательных чисел.";
  20.     return 0;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top