#include<iostream> using namespace std; void YinZi(int n); int main() { int n; cout<<"please input an number : "<<endl; cin>>n; YinZi(n); return 0; } void YinZi(int n) { for(int i=1;i<=n;i++) { if(n%i==0) cout<<i<<" "; } }
#include<iostream> using namespace std; void YinZi(int n); int main() { int n; cout<<"please input an number : "<<endl; cin>>n; YinZi(n); return 0; } void YinZi(int n) { for(int i=1;i<=n;i++) { if(n%i==0) cout<<i<<" "; } }