Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include<stdio.h>
  3.  
  4. void main()
  5. {
  6. FILE *taptin1;
  7. errno_t err;
  8. err = fopen_s(&taptin1, "D:/taptin1.txt", "w+");
  9. int i, k, a[10][10], n, j;
  10. std::cin >> n;
  11.  
  12. fscanf_s(taptin1, "%d", &n);
  13.  
  14.  
  15. for (i = 0; i < n; i++)
  16. {
  17. for (j = 0; j < n; j++)
  18. {
  19.  
  20. fread(a, sizeof(int), i*j, taptin1);
  21. }
  22.  
  23. }
  24.  
  25. for (int i = 0; i < n; i++)
  26. {
  27. for (int j = 0; j < n; j++)
  28. {
  29. std::cout << a[i][j];
  30. std::cout << " ";
  31. }
  32. std::cout << "\n";
  33. }
  34.  
  35. fclose(taptin1);
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement