返回列表 發帖
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
     int k=1,j=0;
     
     cout<<"英數計算器"<<endl;
     cout<<"輸入一個數值"<<endl;
     cin>>j;
    while (k<=j)
    {
     if(j%k==0)
     {
       cout<<k<<","<<endl;
     }      
     k++;
    }
   system("pause");
   return 0;
}

TOP

返回列表