#include
<stdio.h>
#include
<stdlib.h>
int
main(int argc, char *argv[])
{
int i,x=0,vector[20], n=20, dato, centro,inf=0,sup=n-1;
for (i=0;i<20;i++){
printf("Escriba un
número");
scanf("%d",&vector[i]);
}
printf("Escriba el
número a buscar");
scanf("%d",&dato);
while(inf<=sup)
{
centro=(sup+inf)/2;
if (vector[centro]==dato)
{
printf("Existe\n");
x=1;
break;
}
else if(dato < vector [centro] )
{
sup=centro-1;
}
else
{
inf=centro+1;
}
}
if (x==0)
{
printf("No existe\n");
}
system("PAUSE");
return 0;
}
en pseint como seria??
ResponderEliminaren php como seria?
ResponderEliminarComo puedo hacer este programa en idle python
ResponderEliminarJackpotCity Casino NJ - Use Code JMKHub for $1K Bonus
ResponderEliminarJoin now and get $1000 in free BONUS! Play Slots and table games 밀양 출장안마 and win real 남원 출장마사지 money! Sign 출장안마 up and earn FREECREDIT for a 100% match up 논산 출장안마 to 오산 출장샵 $1000!