1. 二维字符串数组的冒泡排序
#include <stdio.h>
#include <string.h>int main(void)
{char str[5][32] = {0};int i = 0;int j = 0;char tmp[32] = {0};for (i = 0; i < 5; i++){gets(str[i]);}for (i = 0; i < 4; i++){for (j = 0; j < 4-i; j++){if (strcmp(str[j], str[j+1]) > 0){strcpy(tmp, str[j]);strcpy(str[j], str[j+1]);strcpy(str[j+1], tmp);}}}for (i = 0; i < 5; i++){printf("str[%d] = %s\n", i, str[i]);}return 0;
}