java數(shù)組找出重復(fù)元素 C語言,怎樣實(shí)現(xiàn)不確定元素個數(shù)的數(shù)組的數(shù)據(jù)輸入?
C語言,怎樣實(shí)現(xiàn)不確定元素個數(shù)的數(shù)組的數(shù)據(jù)輸入?Int n,iint*a,*B,*cprintf(“請輸入數(shù)組大?。骸保﹕canf(%d”,&n)a=(Int*)malloc(sizeof(In
C語言,怎樣實(shí)現(xiàn)不確定元素個數(shù)的數(shù)組的數(shù)據(jù)輸入?
Int n,iint*a,*B,*cprintf(“請輸入數(shù)組大?。骸保﹕canf(%d”,&n)a=(Int*)malloc(sizeof(Int)*n)B=(Int*)malloc(sizeof(Int)*n)C=(Int*)malloc(sizeof(Int)*n)printf(“請輸入數(shù)組a的數(shù)據(jù):”)for(I=0I<ni){scanf(%d“,&A[i])}printf(“please input data of array B:”)fflush(stdin)for(i=0I<ni)){scanf(%d”,&B[i])}for(i=0I<ni){C[i]=a[i]B[i]}printf(“n array C:”)for(i=0I<ni){printf(“n%d”,C[i])}}