有N个国家名,要求按字母先后顺序排列(用起泡排序法)后输出。#define N 20#include #include void main(){int a[N][30
"XOXOXO", "after" }; //如果输出函数的话,就不能定义指针类型的数组;因为常量不好修改。 printf("排序前\n"); myexport(str); maopao(str); printf("排序后\n"); myexport(str); system("pause"); }
有N个国家名,要求按字母先后顺序排列(⽤起泡排序法)后输 出。#define _CRT_SECURE_NO_WARNINGS #include"stdlib.h"#include"stdio.h"#include"string.h"int maopao(char p[][100]){ char *buf;buf = (char *)malloc(sizeof(char)* 100);printf("%s", p[1]);int i = 0,j=0;for (i = ...