Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #ifndef DEBUG
  5. #define DEBUG(...) printf(__VA_ARGS__)
  6. #endif
  7.  
  8. typedef struct ZnakovniNiz{
  9. char array[5000];
  10. }niz;
  11.  
  12. typedef struct Node{
  13. struct Node *next;
  14. int val;
  15. } node;
  16.  
  17. void push(node **top, int val) {
  18. node *novi;
  19. novi = malloc(sizeof(node));
  20. if(!novi) return;
  21.  
  22. novi->val = val;
  23.  
  24. novi->next = *top;
  25. *top = novi;
  26. }
  27.  
  28. void pop(node **top) {
  29. node *t;
  30. if(!(*top)) return;
  31.  
  32. t = (*top)->next;
  33. free(*top);
  34. *top = t;
  35. }
  36.  
  37. int main() {
  38. node *top = NULL;
  39. niz zagrade[500];
  40. int n;
  41. scanf("%d", &n);
  42.  
  43. for(int i = 0; i < n; i++){
  44. scanf("%s", zagrade[i].array);
  45. }
  46.  
  47. for(int i = 0; i < n; i++){
  48. printf("%s\n", zagrade[i].array);
  49. }
  50.  
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement