  
|
因數分解 (一)
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x;
- cout<<"請輸入一正整數: ";
- cin>>x;
- cout<<x<<"的因數有: ";
- for(int i=1; i<=x; i++)
- {
- if(x%i==0)
- cout<<i<<" ";
- }
- cout<<endl;
- system("pause");
- return 0;
- }
複製代碼 |
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊
|