diff --git a/test01/main.cpp b/test01/main.cpp index 1e88f40..e045a57 100644 --- a/test01/main.cpp +++ b/test01/main.cpp @@ -1,13 +1,18 @@ #include using namespace std; - - -struct Node{ - int first; - int second; -}; - - -int main(){ - +int x[10][10], n, m, k, a, b, c; +int main() { + cin >> n >> m >> k; + for (int i = 0; i < k; i++) { + cin >> a >> b >> c; + x[a][b] = c; // 行优先 + } + for (int i = 1; i <= m; i++) { // 列优先(i=列,j=行) + for (int j = 1; j <= n; j++) { + if (x[j][i] != 0) { // j=行 ,i=列 + cout << x[j][i] << " "; + } + } + } + return 0; }