-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1-27.c
More file actions
164 lines (154 loc) · 2.23 KB
/
Copy path1-27.c
File metadata and controls
164 lines (154 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
//void mat_mul(const int a[4][3], const int b[3][4], int c[4][4])
//{
// int i = 0;
// int j = 0;
// int k = 0;
//
// for (i = 0; i < 4; i++)
// {
// for (k = 0; k < 4; k++)
// {
// for (j = 0; j < 3; j++)
// {
// c[i][k] += a[i][j] * b[j][k];
// }
// }
// }
//}
//
//
//
//
//
//int main()
//{
//
// int a[4][3] = { 1,2,3,5,6,7,8,9,0,1,2 };
// int b[3][4] = { 1,2,5,6,9,8,78,7,5,5,6,3};
//
// int c[4][4] = { 0 };
// mat_mul(a, b, c);
//
// int i = 0;
// int j = 0;
//
// printf("结果为:\n");
// for (i = 0; i < 4; i++) {
// for (j = 0; j < 4; j++)
// {
// printf("%d ", c[i][j]);
// }
// printf("\n");
// }
//
// return 0;
//}
//
//void mat_restore(const int a[4][3], const int b[4][3], int c[2][4][3])
//{
// int i, j,p;
// for (p = 0; p < 2; p++)
// {
// for (i = 0; i < 4; i++)
// {
// for (j = 0; j < 3; j++)
// {
// if (p == 0) {
// c[p][i][j] = a[i][j];
// }
// else
// {
// c[p][i][j] = b[i][j];
// }
// }
// }
// }
//}
//
//void print(int three[2][4][3])
//{
// int p = 0;
// int i = 0;
// int j = 0;
// for (p = 0; p < 2; p++)
// {
// for (i = 0; i < 4; i++)
// {
// for (j = 0; j < 3; j++)
// {
// printf("%d ", three[p][i][j]);
// }
// putchar('\n');
// }
// putchar('\n');
// }
//
//}
//
//
//
//int main()
//{
// int tensu1[4][3] = { 91,63,78,62,72,46,89,34,53,32,54,34 };
// int tensu2[4][3] = { 97,67,82,73,43,46,97,56,21,85,46,35 };
// int tensu3[2][4][3] = {0};
//
// mat_restore(tensu1, tensu2, tensu3);
//
// print(tensu3);
//
//
// return 0;
//}
//
//void fill(int v[][3], int n, int q)
//{
// int i = 0;
// int j = 0;
//
// for (i = 0; i < n; i++)
// {
// for (j = 0; j < 3; j++)
// {
// v[i][j] = q;
// }
// }
//}
//
//
//
//void mat_print(const int m[][3], int n)
//{
// int i = 0;
// int j = 0;
//
// for (i = 0; i < n; i++)
// {
// for (j = 0; j < 3; j++)
// printf("%d ", m[i][j]);
// putchar('\n');
// }
//}
//
//
//int main()
//{
// int m = 0;
// int x[2][3] = { 0 };
// int y[4][3] = { 0 };
//
// printf("赋值给所有元素的值:");
// scanf("%d", &m);
//
// fill(x, 2, m);
// fill(y, 4, m);
//
// printf("--- x ---\n"); mat_print(x, 2);
// printf("--- y ---\n"); mat_print(y, 4);
//
// return 0;
//
//}