C语言 计算整数数组中不同值的数量?答:int[] array = new int[] { 1, 1, 2, 2, 2, 3, 4, 5, 5, 6, 7, 7, 8, 9 };System.out.println(new Test().count(array));} }
C语言,编辑一个函数fun统计给定数组中奇数和偶数的个数答:void main(){ int a[10]={1,2,3,4,5,6,7,8,9,10};int a=0,b=0,i=0;for(i=0;i<10;i++){ if(a[i]%2==0) a++;else b++; } printf("数组中奇数个数%d,偶数的个数%d",a,b);}