java二维数组输入
时间:2020-03-22 12:57:42
收藏:0
阅读:465
import java.util.Scanner; public class test{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); //x轴 int m = scan.nextInt();//y轴 String[] temp= new String[n+1]; for(int i = 0; i< n; i++) { temp[i] = scan.next(); } char[][] p = new char[n][m]; // temp转为二维数组p[n][m]; for(int i = 0; i<n; i++) { for(int j = 0; j< m; j++) { p[i][j] = temp[i].charAt(j); System.out.println(p[i][j]); } } } }
原文:https://www.cnblogs.com/apex-wzw/p/12545236.html
评论(0)