1 Star 0 Fork 0

CS-IMIS-23/20172305TX

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
TwoDArray.java 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
三金 提交于 7年前 . 完成第8章的例子代码
//*************************************************************************************
// TwoDArray.java Author: Lewis/Loftus
//
// Demonstrates the use of two-dimensional array.
//*************************************************************************************
public class TwoDArray
{
//-----------------------------------------------------------------------------------------------
// Creates a 20 array of integers, fills it with increasing integer values, then prints them out.
//------------------------------------------------------------------------------------------------
public static void main(String[] args)
{
int[][] table = new int[5][10];
// Load the table with values.
for (int row=0; row <table.length; row++)
for(int col=0; col <table[row].length; col++)
table[row][col] = row*10 +col;
// Print the table
for (int row = 0; row< table.length; row++)
{
for (int col =0; col<table[row].length; col++)
System.out.print(table[row][col] + "\t");
System.out.println();
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/CS-IMIS-23/20172305TX.git
git@gitee.com:CS-IMIS-23/20172305TX.git
CS-IMIS-23
20172305TX
20172305TX
master

搜索帮助