#include<stdio.h> #include<string.h> //要用strstr()函数来查找字符串 char tracks[][80] = { //歌曲清单 "I left my heart in Harvard Med School", "Newark,Newark - a wonderful town", "Dancing with a Dork", "From here to maternity", "The girl from Iwo Jima", }; void find_track(char search_for[]) { int i; for(i=0;i<5;i++){ if(strstr(tracks[i],search_for)) //显示所有匹配的歌曲 printf("Track %i:'%s' ",i,tracks[i]); } } int main() { char search_for[80]; printf("Search for:"); //输入查找的关键字 fgets(search_for,80,stdin); search_for[strlen(search_for)-1]='