Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include<stdlib.h> // funkcje rand, srand, system
  2. #include<stdio.h>
  3. #include<time.h> //funkcja time
  4. #define R 10
  5.  
  6. int odwrotnie(int tab[][])
  7. {
  8. srand(time(0));
  9. for(int i=0;i<R;i++)
  10. {
  11. for(int j=0;j<R;j++)
  12. {
  13. tab[i][j]=rand()%100 -30;
  14. }
  15. }
  16.  
  17. for(int i=0;i<R;i++)
  18. {
  19. for(int j=0;j<R;j++)
  20. {
  21. printf("%d",tab[i][j]);
  22. }
  23. printf("\n");
  24. }
  25. printf("\n");
  26. printf("\n");
  27. for(int i=9;i>0;i--)
  28. {
  29. for(int j=9;j>0;j--)
  30. {
  31. printf("%d",tab[i][j]);
  32. }
  33. }
  34.  
  35. }
  36.  
  37. int main()
  38. {
  39. int tab[R][R];
  40.  
  41. odwrotnie(tab);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement