程序代码:
#include <stdio.h>
#include <string.h>
int main(void)
{
char* key = "TSW", *ans;
char* token[] = {"老师","学生","工人"};
while ((ans = strchr(key, getchar())) != NULL)
{
printf("欢迎您,%s!\n请继续输入:", token[ans - key]);
getchar();
}
return 0;
}
try this!









