Guest User

Untitled

a guest
Jan 24th, 2020
67
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. for (i = 1; i < N; i++) {
  11. if (a[i] + a[i - 1] > 0)
  12. k++;
  13. }
  14. for (i = 0; i < N; i++) {
  15. if (a[i] % 2)
  16. a[i] = (N - 1 - k);
  17. else
  18. a[i] = k;
  19. }
  20. for (i = 0; i < N; i++)
  21. cout << a[i] << " ";
  22. }
RAW Paste Data