- 30
- 0
- 约2.72千字
- 约 15页
- 2018-01-31 发布于贵州
- 举报
按百家姓顺序对20个姓名排序(C)精选
按百家姓顺序对20个姓名排序
C++
#include iostream.h
#include string.h
void input(char name[][10],int n);
void output(char name[][10],int n);
int getnumber(char name[10]);
void sort(char name[][10],int n);
void main()
{
char name[20][10];
int n;
coutPlease input number of the name n=;
cinn;
coutPlease input n name:\n;
input(name,n);
sort(name,n);
coutafter sort:\n;
output(name,n);
}
void input(char name[][10],int n)
{
for(int i=0;in;i++)
原创力文档

文档评论(0)