#include <iostream>using namespace std;int main()
{int i = 0;int j = 0;cout << "请输入任意整数:" << endl;cin >> j;cout << j << "的因数有:";for (i = 1; i <= j; i++)if(j%i == 0)cout << i <<" ";
}
#include <iostream>using namespace std;int main()
{int i = 0;int j = 0;cout << "请输入任意整数:" << endl;cin >> j;cout << j << "的因数有:";for (i = 1; i <= j; i++)if(j%i == 0)cout << i <<" ";
}