99 Multiplication Table

Source: Internet
Author: User

Describe

The 99 multiplication tables that I learned as a child may be rooted in the memories of our lives, and now let's revisit those warm memories, programmed to output the 99 multiplication table.

Now requires you to output its format and the usual difference Ah! It's the kind of reverse triangle, specific as:


Each of the two formulas is separated by a space ...

 
Input
The first has an integer n, which indicates that there is n set of data (N<10)
followed by n rows, each line has only one integer M (1<=m<=9);
Output
For
each integer m, output the first n rows of the multiplication table as required, as shown in the input and output sample and.
There is a blank line between each two sets of test data results, such as the output sample.
Sample input
3215
Sample output
1*1=1 1*2=2 1*3=3 1*4=4 1*5=5 1*6=6 1*7=7 1*8=8 1*9=92*2=4 2*3=6 2*4=8 2*5=10 2*6=12 2*7=14 2*8=16 2*9=181*1=1 1*2=2 1*3=3 1*4=4 1*5=5 1*6=6 1*7=7 1*8=8 1*9=91*1=1 1*2=2 1*3=3 1*4=4 1*5=5 1*6=6 1*7=7 1*8=8 1*9=92*2=4 2*3=6 2*4=8 2*5=10 2*6=12 2*7=14 2*8=16 2*9=183*3=9 3*4=12 3*5=15 3*6=18 3*7=21 3*8=24 3*9=274*4=16 4*5=20 4*6=24 4*7=28 4*8=32 4*9=36 5*5=25 5*6=30 5*7=35 5*8=40 5*9=45

1 ImportJava.util.Scanner;2 3  Public classMain {4      Public Static voidMain (string[] args) {5Scanner scanner=NewScanner (system.in);6         intT;7         intN;8         inti;9         intJ;Ten          Onet=scanner.nextint (); A          while(true){ -             if(t==0) -                  Break; thet--; -              -n=scanner.nextint (); -              +              for(i=1;i<=n;i++){ -                  for(j=i;j<=9;j++) +System.out.print (i+ "*" +j+ "=" +i*j+ ""); A System.out.println (); at             } -         }      -     }  -}

99 Multiplication Table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.