- 鐵幣
- 3003 元
- 文章
- 1434 篇
- 聲望
- 735 枚
- 上次登入
- 10-3-28
- 精華
- 0
- 註冊時間
- 06-9-29
- UID
- 314768
|
//第一題
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char string_data[12][50]={
"Course",
"Computer Tech.",
"How are you?",
"Watch out!",
"A piece of cake",
"Certified ",
"had never seen",
"starred roof",
"When it rains, it pours",
"What are we going to do",
"it seems like",
"burning the midnight oil"
};
int cmp(const void * a,const void * b)
{
return strcmp( (char *)a,(char *)b );
}
int main()
{
int i;
qsort(string_data,12,sizeof(string_data[0]),cmp);
for(i=0;i<12;i++)
printf("%s\n",strrev(string_data));
return 0;
} |
|