Advertisement
palenda21

Lab4A

Oct 31st, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5.  
  6. int main()
  7. {
  8.     double sum = 0, mult = 1;
  9.     int a[10], i;
  10.     for (i = 0; i < 10; i++)
  11.     {
  12.         cin >> a[i];
  13.     }
  14.     for (i = 0; i < 10; i++)
  15.     {
  16.         if (a[i] % 2 == 0)
  17.             mult *= a[i];
  18.         if (a[i] < 0)
  19.             sum += a[i];
  20.     }
  21.     if (mult != 1)
  22.         cout << "mult = " << mult << endl;
  23.     else
  24.         cout << "There is no chetnih chisel" << endl;
  25.     if (sum != 0)
  26.         cout << "sum = " << sum << endl;
  27.     else
  28.         cout << "There is no negative numbers" << endl;
  29.     system("pause");
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement