#include <stdio.h>
#include <string.h>
#define MAX 10
#define LEN 30
#define QUIT \"quit\"
void main()
{
char db[MAX][LEN];
char name[LEN];
char st[MAX];
int i,num,ok,bingo=0;
printf(\"Enter less than %d name, and type \'quit\' to stop :\",MAX);
i = 0;
ok = 1;
while(ok && i<MAX){
gets(name);
if (strcmp(name, QUIT))
strcpy(db[i++],name);
else
ok=0; //break;
}
num=i;
printf(\"Enter a name to find : \");
scanf(\"%s\", st);
bingo=0;
while(i=0;i<10 && bingo;i++)
{
if(!strcmp(st, db[i]))
bingo=1;
}
if(bingo==0)
printf(\"%s exists in DB.\", st);
else
printf(\"%s peer does not exist in DB.\", st);
}
야 이거 오류왜뜸 ㅡㅡ 분명히 제대로 햇는데
컴파일러가 무슨 에러라고 알려주지 않냐. 폰이라 컴파일러 실행은 못 시키고 에러 알려주면 알려줌
우리가 너를 위해 이걸 컴파일하고 돌려봐야 되겠냐
while 대신에 for을 써야하는 곳이있어요 ㅎㅎㅎ