#include
#define STR_MAX_LEN 100
main()
{
char str[STR_MAX_LEN];
char ch;
int i;
printf("intput stirng ...\n");
i=0;
while((ch = getchar())!='\n' && i
}
str[i] = '\0';
/* 检索元素,并显示位置*/
printf("input the character ..\n");
scanf("%c",&ch);
for(i=0;str[i]!='\0';i++) {
if(str[i] == ch) {
printf("%d",i);
return;
}
printf("not exists..\n");
}
}