Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     const int M = 5;
  6.     int m[M];
  7.     bool c = false;
  8.     for (int i = 0; i < M; i++) {
  9.         cin >> m[i];
  10.     }
  11.     for (int j = 0; j < M; j++) {
  12.         if (m[j] < 0) {
  13.             cout << j << endl;
  14.             c = true;
  15.         }
  16.     }
  17.     if (c == false)
  18.         cout << "Is not here negative elements\n";
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement