返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      int num=0;  int Factor=1;
  7.      cout<<"因數計算器"<<endl;
  8.      cout<<"輸入一個值"<<endl;
  9.      cin>>num;
  10.      while(Factor>=0)
  11.      {
  12.          if(num%Factor)            
  13.           {
  14.            cout<<Factor<<endl;              
  15.           }           
  16.          Factor++;            
  17.      }
  18.      
  19.      system("pause");
  20.      return 0;     
  21. }
複製代碼

TOP

返回列表