Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int n,**niz,s,b;
  7.  
  8. printf("Ucitaj n");
  9. scanf("%d",&n);
  10.  
  11. niz=(int**)malloc((n-2)*sizeof(int*));
  12.  
  13. for(i=2;i<n;i++)
  14. {
  15. niz[i]=i;
  16.  
  17. niz[i]=(int*)malloc(2*sizeof(int));
  18.  
  19. for(j=0;j<2;j++)
  20. {
  21. scanf("%d",&niz[i][j]);
  22. }
  23.  
  24. for(k=0;k<niz[i][2];k++)
  25. {
  26. niz[i]=(int*)realloc(niz,++k*sizeof(int));
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement