返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main ()
  5. {
  6.         cout<<"連續計數:"<<endl;
  7.         for(int i=1; i<=10; i++)
  8.         {
  9.                 cout<<i<<endl;
  10.         }
  11.         cout<<"跳躍計數:"<<endl;
  12.         for(int i=1; i<=9; i+=2)
  13.         {
  14.                 cout<<i<<endl;
  15.         }
  16.         cout<<"倒序計數:"<<endl;
  17.         for(int i=10; i>=1; i--)
  18.         {
  19.                 cout<<i<<endl;
  20.         }
  21.        
  22.         system("pause");
  23.         return 0;
  24. }
複製代碼

TOP

返回列表