Professional Documents
Culture Documents
un numero ') c=0; for j=1:i if n==A(j) c=c+1; end end if c==0 A(i)=n; else while c>0 n=input('ingrese un numero diferente a los ingresados ') c=0; for j=1:i if A(j)==n c=c+1; end end end A(i)=n; end end A
>> v=zeros(1,16) v= 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
n= 8 ingrese un numero 3 n= 3 ingrese un numero 6 n= 6 ingrese un numero 1 n= 1 ingrese un numero 2 n= 2 ingrese un numero 3 n= 3 ingrese un numero diferente a los ingresados 4 n= 4 ingrese un numero 5 n= 5 ingrese un numero 6 n= 6
n= 7 ingrese un numero 8 n= 8 ingrese un numero diferente a los ingresados 9 n= 9 ingrese un numero diferente a los ingresados 20 n= 20 ingrese un numero 11 n= 11 ingrese un numero 12 n= 12 ingrese un numero 14 n= 14 ingrese un numero 19 n=
n= 17 A=
7 20 11 12 14 19 18 17