[求助]着两个程序有啥区别!
#include <conio.h>
#include <stdio.h>
void fun(int x, int pp[], int *n)
{ int i,j=0;
for(i=0;i<=x;i++)
if(x%i==0&&i%2!=0)
pp[j++]=i;
*n=j;
}
main()
{ int x, aa[1000], n, i;
printf("\n please enter an integer number:\n"); scanf("%d",&x);
fun(x,aa,&n);
for(i=0;i<n;i++)
printf("%d ", aa[i]);
printf("\n");
}
#include <conio.h>
#include <stdio.h>
void fun(int x, int pp[], int *n)
{ int i,j=0;
for( i=1;i<=x; i=i+2)
if( x%i==0)
pp[j++]=i;
*n=j;
}
main()
{ int x, aa[1000], n, i;
printf("\n please enter an integer number:\n"); scanf("%d
",&x);
fun(x,aa,&n);
for(i=0;i<n;i++)
printf("%d ", aa[i]);
printf("\n");
}