满意答案
yiyi89757
2014.05.16
采纳率:49% 等级:9
已帮助:265人
#include
#include
#define N 7
sort(char *language[N]);
output(char *language[N]);
main()
{
char *language[N]={"PASCAL","BASIC","C/C++","Fortran","Turbo C","JAVA"};
sort(language);
output(language);
}
sort(char *language[N])
{
int i,j;
char t[50];
for(i=0;i
for(j=0;j
if(strcmp(language[i],language[j])>0)
{
strcpy(t,language[i]);
strcpy(language[i],language[j]);
strcpy(language[j],t);
}
}
output(char *language[N])
{
int i;
for(i=0;i
printf("%s",language[i]);
}
//自己再修改一下,调试的时候我这出点问题,但是做题思路是这样的,帮不了你了
00分享举报