fork download
  1. #include <iostream>
  2. #include <locale.h>
  3. #include <stdlib.h>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char* argv[]) {
  8. setlocale(LC_ALL, "Russian");
  9. int temp;
  10. int mass[10][10];
  11. for (int i=0; i<=9; i++)
  12. {
  13. for (int j=0; j<=9;j++)
  14. {
  15. mass[i][j]=rand()%98+1;
  16. printf("%d\t",mass[i][j]);
  17. }
  18. printf("\n");
  19. }
  20. printf("\n");
  21. printf("Элементы побочной диагонали матрицы: \n");
  22. for (int i=0; i <= 10; i++)
  23. {
  24. for (int j=0; j<=10 ; j++)
  25. {
  26. if ( i+j == 10-1) {
  27. printf("%d ", mass[i][j]);
  28.  
  29. }
  30. }
  31. }
  32. printf("\n");
  33.  
  34. system("pause");
  35. return 0;
  36. }
  37.  
  38.  
Success #stdin #stdout #stderr 0.01s 5288KB
stdin
Standard input is empty
stdout
16	89	38	6	30	60	25	73	58	18	
59	48	7	68	70	71	67	23	73	73	
4	71	6	38	31	97	83	98	30	6	
6	1	95	97	60	80	58	85	10	17	
58	68	20	64	91	46	91	59	24	65	
88	27	92	93	65	24	47	5	23	32	
10	28	33	6	81	48	41	40	88	50	
13	4	73	32	67	66	33	15	80	57	
36	25	83	29	19	5	8	66	9	30	
97	19	13	85	78	93	89	21	89	78	

Элементы побочной диагонали матрицы: 
18 73 98 58 46 65 6 73 25 97 
stderr
sh: 1: pause: not found