首页 > 代码库 > URAL 1313 Some Words about Sport
URAL 1313 Some Words about Sport
斜着数
1 import java.util.Scanner; 2 3 public class P1313 4 { 5 public static void main(String args[]) 6 { 7 try (Scanner cin = new Scanner(System.in)) 8 { 9 while (cin.hasNext())10 {11 int n = cin.nextInt();12 int a[][] = new int[n][n];13 for (int i = 0; i < n; i++)14 for (int j = 0; j < n; j++)15 a[i][j] = cin.nextInt();16 for (int k = 0; k < 2 * n - 1; k++)17 for (int j = 0; j < n; j++)18 {19 int i = k - j;20 if (i >= 0 && i < n)21 System.out.print(a[i][j] + " ");22 }23 System.out.println();24 }25 }26 }27 }
URAL 1313 Some Words about Sport
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。