Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Use the binary search method to find characters, define char characters and integer characters, and use the knowledge of data structures to do the search
Use the binary search method to find characters, define char characters and integer characters, and use the knowledge of data structures to do the search

#include?

#include?

#define?N?5

#define?M?30

int?flag=1;/*Global variable, used to determine the search results of the search function*/

main()

{

int?num[N],i,j,n;

char?name[N][M];

system("cls ");

printf("please?input?%d?employees?information./n",N);/*employee: employee, staff, employee*/

for (i=0;i

{

printf("NO.%d:?",i+1);

scanf ("%d?",&num[i]);?/*

There is a space after %d. The function of this space is to recycle all the space characters after the numeric characters and before the non-numeric characters. So that when printing employee names, there will be no space characters in front of the names