Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #define MAX 100
  3.  
  4. int main()
  5. {
  6. int tab[MAX], i, n;
  7.  
  8. printf("Podaj ilosc liczb (max 100)\n");
  9. scanf("%d", &n);
  10.  
  11. for(i=0; i<n; i++){
  12. printf("Podaj %d wyraz ciagu\n", i+1);
  13. scanf("%d", &tab[i]);
  14. }
  15.  
  16.  
  17.  
  18. printf("Mamy ciag: \n");
  19. for(i=0; i<n; i++)
  20. printf("%d, ", tab[i]);
  21.  
  22. printf("\n");
  23. printf("Ciag po odwroceniu: \n");
  24. for(i=n-1; i>=0; i--)
  25. printf("%d, ", tab[i]);
  26.  
  27. printf("\n");
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement