请把9*9乘法表打出来,可以顺着、倒着、怎么好玩怎么搞。。。下面是我写的俩- class ChenFaBiao {
- public static void main(String[] args) {
- //形式一
- /*for (int x=9;x>=1 ;x-- ) {
- for (int y=1;y<=x ;y++ ) {
- System.out.print(y+"*"+x+"="+y*x+"\t");
- }
- System.out.println();
- }*/
- //形式二
- for (int x=9;x>=1 ;x-- ) {
- for (int n=8;n>=x ;n-- ) {
- System.out.print(" "+" "+" "+" "+" "+"\t");
- }
- for (int y=x;y>=1 ;y-- ) {
- System.out.print(y+"*"+x+"="+y*x+"\t");
- }
- System.out.println();
- }
- }
- }
复制代码 |
|