返回列表 發帖

108九九乘法表

程式由左至右顯示.....
May

  1. public class jva108
  2. {
  3.         public static void main(String arg[])
  4.         {
  5.                 for(int j=1;j<=9;j++)
  6.                 {
  7.                         for(int i=1;i<=9;i++)
  8.                         {
  9.                         System.out.printf("%d*%d=%d\t",j,i,j*i);
  10.                         }
  11.                 System.out.println();
  12.                 }
  13.         }
  14. }
複製代碼
水桶小鄭,鯰魚

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     for(int i=1;i<=9;i++)
  7.     {
  8.         //cout<<i<<endl;
  9.         for(int j=1;j<=9;j++)
  10.         {
  11.             cout<<i<<"*"<<j<<"="<<i*j<<"\t";
  12.                     
  13.                
  14.                
  15.         }
  16.         cout<<"\n";         
  17.     }
  18.    
  19.     system("pause");        
  20.     return 0;   
  21. }
複製代碼
★ 嘉凱~~☆

TOP

阿嘉放的是C++的程式碼!9 T! f" d: Z" V" G, k; a% Y+ Z
你沒做吧~~
  1. public class TQC108 {
  2.         public static void main(String arg[]) {
  3.                 for (int j = 1; j <= 9; j++) {
  4.                         for (int i = 1; i <= 9; i++) {
  5.                                 System.out.printf("%d*%d=%d\t", j, i, j * i);
  6.                         }
  7.                         System.out.println();
  8.                 }
  9.         }
  10. }
複製代碼
小雲雀

TOP

返回列表