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 ();