about summary refs log tree commit diff
path: root/usth/MATH2.3/2/adjmat2edges.cc
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2020-01-14 18:29:11 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2020-01-14 18:29:11 +0700
commita3dd2581ed4847670f81157091016c14ca18803d (patch)
tree3362ab15de119f1e75799f58715b7683e6bfd6ca /usth/MATH2.3/2/adjmat2edges.cc
parent65b8ebda4c47fa27ac28899fb2b29097f445b6df (diff)
downloadcp-a3dd2581ed4847670f81157091016c14ca18803d.tar.gz
[usth/MATH2.3] Mathemate Discretely
Diffstat (limited to 'usth/MATH2.3/2/adjmat2edges.cc')
-rw-r--r--usth/MATH2.3/2/adjmat2edges.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/usth/MATH2.3/2/adjmat2edges.cc b/usth/MATH2.3/2/adjmat2edges.cc
new file mode 100644
index 0000000..d9cf14f
--- /dev/null
+++ b/usth/MATH2.3/2/adjmat2edges.cc
@@ -0,0 +1,18 @@
+#include <iostream>
+
+using namespace std;
+
+int
+main ()
+{
+  size_t n;
+  int b;
+  cin >> n;
+  for (size_t i = 0; i < n; ++i)
+    for (size_t j = 0; j < n; ++j)
+      {
+        cin >> b;
+        if (i <= j && b > 0)
+          cout << i << " " << j << " " << b << endl;
+      }
+}