C语言学习006:歌曲搜索

 #include <stdio.h>
#include <string.h> //字符串处理库 char tracks[][]={
"I left my heart in Harvard Med School",
"Newwark,Newwark - a wonderful town",
"From here to maternity",
"The girl from Iwo Jima",
}; void find_track(char search_for[]){
int i;
for(i=;i<;i++){
if(strstr(tracks[i],search_for))//strstr字符串查找,如果找到返回字符串在存储器中的位置,如果没有找到返回0
printf("Track %i: '%s'\n",i,tracks[i]);
}
} int main(){
char search_for[];
printf("Search for:");
fgets(search_for,,stdin);
search_for[strlen(search_for)-]='\0';//strlen返回字符串的长度
find_track(search_for);
return ;
}

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZ0AAADMCAIAAAAnGOkTAAAN2klEQVR4nO2dv27ryBWH9Th8AbcqBKg0sBC2cBUbMAykcrtMn8aVN2lS3CaVn+ICvl2AIFtttV0eIW+gFJLo+XPOcEgOOdTR9+GHhUSNhjPkzKchJd/d/PzLr4QQYimbn3/59fXbd0IIycy/fvppDdGah9cIIYNT3Wh4jRBSONWNhtcIIYVT3Wh4jRBSONWNhtcIIYVT3Wh4jRCipkmivau60fAaIUTNwl47Ho/H4zG9Ba8RQiYlIa+Z1muuyKZIrYDX3v/+j0ERK3k4NM22ffY2vu+aZtdGxRx27ftO/ix5fLi85flln/jMCeqvG+kg5OTjfts0h/fq7Sd9ubIztbzXOp1NlFoZr/3+x3+1/Pkvf3P/K3utfYyEs7/bRtsuc/7h0Ny9fLx++/767X13UdjXxrf2LvCaPJI+7reDvOY5NHqjZuGvllza1jX+qxnN4f38YI1eE7q28jiff/v7t+hYXXBG0TIdxGsjL0jreO3f//ktM5LX3ndNc/fy7p/y9922fVYG3PJeOy363MIPh2DCSKut9jGYV+fFo1vsrb2bOqlmny1jF5K9mUUozy/7rs7nl717CpyR433GzNbBpc9U2dz6em2TTew1d6g9HJpd649FX1LRWxa5Do30JOetvQuLnZTdrc4+7rfN7sXvUWblqcw/W4SuFcn8C6Xkx8aXzubq4NJnShvno2sb8VKplVr9+2tTvH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bwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgDbwGANbAawBgjcBrT09PgcXiLXgNAFZN7DVXZMFTvAYAV4DotZPL3Md4DQCuhvj+2pMP99cA4MoQvzdISA2vAcDa0b4P1aSG1wBg7fA7DwCwBl4DAGvgNQCwBl4DAGss7bUjAMDMDJXaVK+N2N9vAPMwYjSCVfAaGKH43IDrBa+BEYrPDbhe8BoYofjcgOtlFq8l/nSr9uAHs8w5TWBG0n/pOY7yXku3svbgB7MUnBWwMMXVVthrve2rPfjBLKWmBFRhoto+Pz8/Pz+7pyW9ltOy2oMfzDJuPsB6mKK2Gb2W07Lagx/MMmIywHooeynK/TUwQpH5AFUYLbVumTbveq23lbUHP5hl6JSAlVDk8nMJryWoPfjBLCNGI1gFr4ERis8NWC3xMo31Gtik1JyB9YPX4FYoNWfAAEt7DQBgbiZ5jRBC1pmRXiOEkKsLXiOEWAteI4RYC14jhFgLXiOEWAteI4RYC14jhFgLXiOEWMvZa4QQYin/B89xNvLTE3wbAAAAAElFTkSuQmCC" alt="" />

上一篇:python学习day10 函数Ⅱ(参数&作用域)


下一篇:jquery-barcode:js实现的条码打印