該矩陣必須重新做輸出,每個方格以一個4x6的字元表示,下列依序為黑色方格、被賦予編號的白方格與未被賦予編號的白方格:
++++++ ++++++ ++++++ ++++++ +nnn + + + ++++++ + + + + ++++++ ++++++ ++++++
若黑色方格在四週則不需要繪出,請參考範例資料。請注意圖形每列的最後不可有多餘的空白字元。
Input
每組測試資料的第一列有兩個整數分別表示 m, n (m, n < 25),接下來的 m 列每列有 n 個0或1的整數,每個整數之間皆以一個空白字元隔開。當 m = n = 0 表示測試資料結束。
Output
請繪出該字謎的圖形。請在每組資料之後輸出一列空行。
Sample Input
6 7 1 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 5 3 1 0 1 0 0 0 1 1 1 0 0 0 1 0 1 0 0
Sample Output
+++++++++++++++++++++ +001 + +002 +003 + + + + + + ++++++++++++++++++++++++++++++++++++ +004 + ++++++005 + +006 +007 + + + ++++++ + + + + ++++++++++++++++++++++++++++++++++++ +008 + +009 + + +010 + + + + + + + + + + +++++++++++++++++++++ +++++++++++ + ++++++011 + + + ++++++ + + ++++++++++++++++++++++++++++++++++++ +012 +013 + ++++++014 +015 + + + + + ++++++ + + + ++++++++++++++++++++++++++++++++++++ +016 + + + + + + + + + + + ++++++++++++++++++++++++++ ++++++ +001 + + + ++++++++++++++++ +002 + + + + + + + ++++++++++++++++ ++++++++++++++++ +003 +004 + + + + + + ++++++++++++++++ + + + + ++++++
原文出處
沒有留言:
張貼留言