SHARE
TWEET

Untitled

a guest Jan 24th, 2020 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // 1
  2. const int N = 50;
  3.  
  4. int main(){
  5.     long a[N];
  6.     long i, k, m;
  7.     for (i = 0; i < N; i++)
  8.         cin >> a[i];
  9.     k = 0;
  10.     m = 0;
  11.     for (i = 1; i < N; i++) {
  12.         if (a[i] + a[i - 1] > 0)
  13.             k++;
  14.         if (a[i] + a[i - 1] == 0)
  15.             m++;
  16.     }
  17.     for (i = 0; i < N; i++) {
  18.         if (a[i] % 2)
  19.             a[i] = (N - 1 - k - m);
  20.         else
  21.             a[i] = k - m;
  22.     }
  23.     for (i = 0; i < N; i++)
  24.         cout << a[i] << " ";
  25. }
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