Board logo

標題: [作業] while 迴圈 - 九九乘法表 [打印本頁]

作者: tonyh    時間: 2013-12-7 17:54     標題: [作業] while 迴圈 - 九九乘法表

[attach]770[/attach]
使左上角顯示 9*9=81  右下角顯示 1*1=1
作者: 張彥承    時間: 2013-12-7 18:02

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

作者: 張郁偵    時間: 2013-12-7 18:03

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

作者: 張峻瑋    時間: 2013-12-7 18:04

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;

  4. int main()
  5. {
  6.     int i=9;
  7.     while (i>=1)
  8.     {
  9.         int j=9;
  10.         while (j>=1)
  11.         {
  12.              cout<<i<<"*"<<j<<"="<<i*j<<"\t";
  13.              j--;   
  14.         }
  15.         cout<<endl;
  16.         i--;
  17.     }
  18.    
  19.     system("pause");
  20.     return 0;
  21. }
複製代碼

作者: 張郁庭    時間: 2013-12-7 18:06

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

作者: 周雍程    時間: 2013-12-7 18:08

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;

  4. int main()
  5. {
  6.     int i=9;
  7.     while(i>=1)
  8.     {
  9.         int j=9;
  10.         while(j>=1)
  11.         {
  12.              cout<<i<<"*"<<j<<"="<<i*j<<"\t";
  13.              j--;  
  14.         }      
  15.         cout<<endl;
  16.         i--;
  17.     }   
  18.     system("pause");
  19.     return 0;
  20. }
複製代碼

作者: 施伯叡    時間: 2013-12-14 09:30

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





歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/) Powered by Discuz! 7.2