1 #include2 #include 3 #include 4 //using namespace std; 5 int main() 6 { 7 int a[]={ 1,2,20,1,1,2}; 8 int b[]={ 0}; 9 int num=0;10 int len=sizeof(a)/4;11 printf("%d\n",len);12 for(int j=0;j
java代码实现数组去重复:
1 package uhio; 2 import java.util.*; 3 public class tyutuy { 4 5 public static void main(String[] args) { 6 // TODO Auto-generated method stub 7 int []a=new int[6]; 8 a[0]=0; 9 a[1]=1;10 a[2]=1;11 a[3]=2;12 a[4]=0;13 a[5]=5;14 ArrayListlist = new ArrayList ();15 for (int i=0; i
输出:
[0, 1, 2, 5];