Problems Description
<p><span style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;">在n*n方陈里填入1,2,...,n*n,要求填成蛇形。例如n=4时方陈为:</span><br style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;" /> <span style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;">10 11 12 1</span><br style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;" /> <span style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;">9 16 13 2</span><br style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;" /> <span style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;">8 15 14 3</span><br style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;" /> <span style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;">7 6 5 4</span></p> <p></p>
Input格式
<p>直接输入方陈的维数,即n的值。(n<=100)</p> <p></p>
Output格式
<p><span style="color: rgb(70, 70, 70); font-family: Tahoma, Arial, sans-serif, simsun; font-size: 14px; line-height: 16.8px;">输出结果是蛇形方陈。</span></p> <p></p>
Sample
Sample Input 1
3
Sample Output 1
7 8 1
6 9 2
5 4 3
Submit Code
请先Login后Submit
🤖 AI 解题助手
OpenRouter
就绪