fork download
  1. // ConsoleApplication1.cpp: определяет точку входа для консольного приложения.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "time.h"
  6. #include "stdlib.h"
  7.  
  8. void main()
  9. {
  10. srand((unsigned)time(NULL));
  11. int n;
  12. int **matrix;
  13. scanf_s("%i", &n);
  14. matrix = new int*[n];
  15. for (int i = 0; i < n; i++)
  16. {
  17. matrix[i] = new int[n];
  18. for (int j = 0; j < n; j++)
  19. matrix[i][j] = rand() % 10;
  20. }
  21.  
  22. for (int i = 0; i < n; i++)
  23. {
  24. for (int j = 0; j < n; j++)
  25. printf("%i ", matrix[i][j]);
  26. printf("\n");
  27. }
  28. system("PAUSE");
  29. }
  30.  
  31.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
5
compilation info
prog.c:4:20: fatal error: stdafx.h: No such file or directory
 #include "stdafx.h"
                    ^
compilation terminated.
stdout
Standard output is empty