标签:ted highlight str lis tor ast port generate ++
import java.util.*; public class nineninelist { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub datastore(); } private static void datadesplay(int array[][],int i,int j) {//输出函数 // TODO Auto-generated method stub System.out.println(array[i][j]); } private static void datadesplay(int array[][],int i) { // TODO Auto-generated method stub for(int j=0;j<=i;j++) System.out.print((i+1)+"*"+(j+1)+"="+array[i][j]+" "); } private static void datadesplay(int array[][]) { // TODO Auto-generated method stub for(int i=0;i<9;i++) { for(int j=0;j<=i;j++) System.out.print((i+1)+"*"+(j+1)+"="+array[i][j]+" "); System.out.println(); } } private static void datastore() {//存储和调用输出 // TODO Auto-generated method stub int array[][]=new int[9][];int x,y; Scanner in=new Scanner(System.in); for(int i=0;i<9;i++) { array[i]=new int[i+1]; for(int j=0;j<=i;j++) { array[i][j]=(i+1)*(j+1); } } while(true) { System.out.println("***乘法表***"); System.out.println("1...位置输出"); System.out.println("2...行输出"); System.out.println("3...表打印"); System.out.println("4...exit"); int io=in.nextInt(); switch(io) { case 1: x=in.nextInt(); y=in.nextInt(); datadesplay(array,x,y); break; case 2: x=in.nextInt(); datadesplay(array,x-1); break; case 3: datadesplay(array); break; case 4: System.exit(0); break; } } } }
标签:ted highlight str lis tor ast port generate ++
原文地址:http://www.cnblogs.com/wgx521/p/7586608.html