按百家姓顺序对20个姓名排序〔C〕.docVIP

  • 0
  • 0
  • 约1.62千字
  • 约 2页
  • 2017-06-09 发布于北京
  • 举报
按百家姓顺序对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++) cinname[i]; } void output(char name[][10],int n) { for(int i=0;in;i++) { coutname[i]; coutendl; } } int getnumber(char name[10]) { char *p[100]={赵,钱,孙,李

文档评论(0)

1亿VIP精品文档

相关文档