Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace b
  3. int main()
  4. {
  5. int n, aux = 0;
  6. scanf("%d", &n);
  7.  
  8. double array [n];
  9.  
  10. for (int i = 0 ; i < n ; i++)
  11. {
  12. scanf("%lf", &array[i]);
  13. if(aux) printf("%.0lf\n", floor(array[i]/2));
  14. else printf("%.0lf\n", ceil(array[i]/2));
  15. if((int)array[i] % 2 != 0) aux = !aux;
  16. }
  17.  
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement