Cycle-12. Print the 9th tip table, and cycle-12 tips

Source: Internet
Author: User

Cycle-12. Print the 9th tip table, and cycle-12 tips

1/* 2 * Main. c 3 * C12-loop-12. print 9-9 formulas Table 4 * Created on: July 31, 2014 5 * Author: boomkeeper 6 ******** passed the test ********* 7 */8 9 10 # include <stdio. h> 11 12 int main (void) {13 14 int N = 0; // N15 16 scanf ("% d", & N); 17 int I, j; // control rows and columns 18 for (I = 1; I <= N; I ++) {19 for (j = 1; j <= I; j ++) {20 printf ("% d * % d = % d \ t", j, I, j * I); 21} 22 printf ("\ n "); 23} 24 return 0; 25}

Question link:

Http://pat.zju.edu.cn/contests/basic-programming/%E5%BE%AA%E7%8E%AF-12

 

 

 


Write a method and print the 9-9 multiplication table using a for loop.

Private Sub Form_Click ()
Dim I, j, k As Integer
Print String (100, "*") 'Print *
Print Tab (45); "9-9 rule" 'sets the title
Print String (100 ,"*")
For I = 0 To 9
Print Tab (I * 8); I; 'print the 0-9 column at a position multiple of 8.
Next I
Print
For j = 1 To 9
Print j; 'print 9 rows
For k = 1 To j
Print Tab (k * 8); j & "X" & k; "=" & j * k; 'corresponding column Print rule table
Next k
Print
Next j
End Sub
It should be clear! Ask me again
I didn't speak any language. I only gave VB. Sorry.

62 compile a C # console application and print the 9-9 multiplication table using the double for loop statement

For (int I = 1; I <= 9; I ++ ){
For (int j = 1; j <= I; j ++ ){
Console. Write (j + "*" + I + "=" + j * I );
}
Console. Write ("\ n ");
}
Console. ReadLine ();

Related Article

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.