#include <iostream>
using namespace std;
int fun(int x, int *pp);
int main()
{
int a[50],x,n;
cin>>x;
n=fun(x,a);
cout<<n<<endl;
for(int i=0; i<n; i++)
cout<<a[i]<<" ";
cout<<endl;
return 0;
}
int fun(int x, int *pp)
{
int n=0,i;
for(i=1;i<=x;i++)
{
if((x%i==0)&&(i%2!=0))
{
*pp=i;
n++;
pp++;
}
}
return n;
}
运行结果: