Advertisement
feunta

Denis

Oct 25th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include"stdafx.h";
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. int i = 0, p = 0, neg = 0;  
  9.    
  10.     int a;
  11.     while (i < 20){
  12.         cout << "vvedite chislo =";
  13.         cin >> a;
  14.         if (a > 0) p++;
  15.         else if (a < 0) neg++;
  16.         i++;
  17.     }
  18.     cout << "p: " << p << ", neg: " << neg << endl;
  19.  
  20.    
  21.     system ("pause");
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement