# include
# include
Struct web
{
Char abbr [8].
Char name [12].
Char URL [40];
};
Void sort (struct web webs [], int n);
# define N 4
Int main (void) {
Struct web webs [N].
int i;
Char abbr [8].
for(i=0; IThe scanf (" % s % s % s ", webs [I] abbr, webs [I]. Name, webs [I] URL);
The scanf (" % s ", abbr);
Sort (webs, N);
for(i=0; IPrintf (" % s % s % s \ n ", webs [I] abbr, webs [I]. Name, webs [I] URL);
for(i=0; IIf (STRCMP (abbr, webs [I] abbr)==0) {
Printf (" % s ", webs [I] URL);
break;
} else if (I==N - 1) {
Printf (" search url was not found ");
}
}
}
Void sort (struct web webs [], int n) {
Struct web temp;
int i,j;
for(i=0; IFor (j=0; J If (STRCMP (webs [j]. Journal of abbr, webs [j + 1] abbr) & gt; 0 {
Temp=webs [j];
Webs [j]=webs [j + 1);
Webs [j + 1)=temp;
}
}
CodePudding user response:
I also don't know where you are wrong you what is the error of the code you want to do good difficult to let me guessCodePudding user response: