简体   繁体   English

用户生成的多维数组的输出数据

[英]Output data from a user-generated multi-dimensional array

I have a multi-dimensional array with 5 rows and 5 columns. 我有一个5行5列的多维数组。 The first 5 rows are social issues. 前5行是社会问题。 The user has to enter an integer value rate each social issue from a scale 1(lease important) to 10(very important). 用户必须为每个社会问题输入从1(重要等级)到10(非常重要)的整数比率。

How can I output the data to a table? 如何将数据输出到表?

 for (int col = 1; col < poller[row].length; col++) {
        poller[row][col] = input.nextInt();
    }

This will print your data to the console. 这会将您的数据打印到控制台。

int length = poller.length;
for (int row = 0; row < length; row++) {
  int rowLength = poller[row].length;
  System.out.println("");
  for (int col = 0; col < rowLength; col++) {
    System.out.print(poller[row][col]);
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM