  
|
[隨堂測驗] 因數(七)
設計一程式, 使能列出任一正整數的所有因數, 參考執行畫面如下:

完成以下程式碼- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
-
- cout<<"請輸入一正整數: ";
- cin>>x;
- cout<<x<<"的因數有: ";
- for( ; ; )
- {
- if( )
- cout<<i<<" ";
- }
- cout<<endl;
- system("pause");
- return 0;
- }
複製代碼 |
|