Advertisement
jordanov

Untitled

Nov 22nd, 2020
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int n,i;
  6. scanf("%d",&n);
  7. int niza[n];
  8. for(i=0;i<n;i++){
  9. scanf("%d",&niza[i]);
  10. }
  11. for(i=0;i<n;i++){
  12. printf("%d ",niza[i]);
  13. }
  14. printf("\n");
  15. for(i=n-1;i>=0;i--){
  16. printf("%d ",niza[i]);
  17. }
  18. printf("\n");
  19. for(i=n-1;i>=0;i--){
  20. if(i%2==0){
  21. printf("%d ",niza[i]);
  22. }
  23. }
  24.  
  25. printf("\n");
  26. for(i=0;i<n;i++){
  27. if(i%2==0){
  28. printf("%d ",niza[i]);
  29. }
  30. }
  31.  
  32.  
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement