组数游戏,我这个程序去零要怎么实现


#include<stdio.h>//头文件 
#include<unistd.h>
#include<string.h>
#define N 20//宏定义N等于20
int max = 0;//定义变量并初始化
void getnum();
void tuozhan();
void paixu();   /*函数的声明*/
void chuling();
void shuchu();
    int n, tmp, m, i, j;//定义变量
    struct
{
 char data[20];
 char ext_data[20];/*结构体*/
}Elem[N], ti;//定义结构体数组和变量

int main()//主函数以及函数的调用
{
 printf(" ************************************\n");
 printf("          欢迎来到组数游戏            \n");
 printf(" ************************************\n\n");
 printf("请输入你需要输入的整数个数(小于20)\n");
 getnum();
 tuozhan();//函数的调用
 paixu();
 shuchu();
 return 0;//返回值为零
}


void getnum()//获取数值以及求出最大位数
{
 int i;
 scanf("%d", &n);//获取整数个数
 if (n > 20)
 {
  printf("你输入的数字大于20\n");
 }
 for (i = 0; i < n; i++)
 {
  printf("请输入第%d个整数\n", i + 1);
  scanf("%s", Elem[i].data);
  strcpy(Elem[i].ext_data, Elem[i].data);
  tmp = strlen(Elem[i].data);
  if (tmp > max)
  {
   max = tmp;
  }
 }
}


void tuozhan()//计算拓展数
{
 for (i = 0; i < n; i++)
 {
  tmp = strlen(Elem[i].ext_data);//计算字符串的长度不含'\0'
  /*利用for循环对Elem[i].ext_data[j]进行补零*/
  for (j = tmp; j <= max; j++)
  {
   Elem[i].ext_data[j] = '0';
  }
  Elem[i].ext_data[max] = '\0';//给Elem[i].ext_data[j]增加字符串结束标志
 }
}


void paixu()//对于Elem[i].ext_data[j]进行排序
{
 /*利用冒泡排序*/
 for (i = 0; i < n; i++)
 {
  for (j = 0; j < n - 1; j++)
  {
   if (strcmp(Elem[j].ext_data, Elem[j + 1].ext_data) < 0)//利用strcmp进行比较字符串一.小于字符串 二.返回负数
   {
    memcpy(&ti, &Elem[j], sizeof(ti));
    memcpy(&Elem[j], &Elem[j + 1], sizeof(ti));/*利用内存复制函数进行交换利用字节数*/
    memcpy(&Elem[j + 1], &ti, sizeof(ti));
   }
  }
 }
}


void shuchu()
{
 printf("输出的最大数为:");
 for (i = 0; i < n; i++)
 {
  printf("%s", Elem[i].data);//利用for循环将Elem[i].data数据输出
 }
 printf("\n");
}

这段代码是实现什么功能?