c139. 蛇型函數
Tags :
Accepted rate : 2人/2人 ( 100% ) [非即時]
評分方式:
Tolerant

最近更新 : 2025-04-23 13:01

Content

寫一個程式,輸入一個正整數n(1<n<20),輸出一個n*n方陣,並用蛇行方式填入1~n2

 

Input

輸入一個正整數n

Output

用蛇形方法輸出n*n方陣

Sample Input #1
4
Sample Output #1
1 2 3 4 
8 7 6 5
9 10 11 12
16 15 14 13
Sample Input #2
3
Sample Output #2
1 2 3
6 5 4
7 8 9
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (33%): 1.0s , <1K
公開 測資點#1 (33%): 1.0s , <1K
公開 測資點#2 (34%): 1.0s , <1K
Hint :
Tags:
出處:
[管理者: stu210106(lin) ]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」