#include<iostream> using namespace std; int main() { int n; cout<<"输入n值"; cin>>n; cout<<"Number"<<n<<"Factor"; for(int i = 1;i<=n;i++) if(n%i == 0) cout<<i<<" "; return 0; }
输入n值36 Number36Factor1 2 3 4 6 9 12 18 36 Process returned 0 (0x0) execution time : 2.946 s Press any key to continue.