int main(){ int s=0,i;for(i=1;i<20;i=i+2){ s+=i;} printf("1-20内的奇数和为%d",s);return 0;}
假设array [10],如果array[i]%2 != 0,则为偶数,反之为奇数。