#include<stdio.h>
#include<stdlib.h>
void main()
{
FILE*fp;
int i,a[1000],n=0;
fp=fopen("E:\\wj4.txt","r");//wj4.txt里存储一千个数
if((fp=fopen("E:\\wj4.txt","r"))==NULL)
{printf("error");
}
for(i=0;i<1000;i++)
{fscanf("%d",a[i]);
if(a[i]%2!=0)
n++;}
fclose(fp);
printf("%d",n);
}
求这一千个数中奇数的个数,大神指点一下,谢谢
lvanli