返回列表 發帖
  1. #include <cstdlib>
  2. #include <iostream>
  3. using namespace std;
  4. void test(int start,int end)
  5. {
  6.      for(int i=start;i<=end;i++)
  7.      {
  8.              for(int j=start;j<=end;j++)
  9.              {
  10.                      cout<<i<<"*"<<j<<"="<<i*j<<"\t";
  11.              }
  12.              cout<<endl;
  13.      }
  14. }
  15. int main()
  16. {
  17.     int start=0;
  18.     int end=0;
  19.     cout<<"請輸入開始的數:";
  20.     cin>>start;
  21.     cout<<"請輸入結束的數:";
  22.     cin>>end;
  23.     test(start,end);
  24.     system("pause");
  25.     return 0;
  26. }
複製代碼

TOP

返回列表