程设小组作业——计算机配件的进货/销售管理系统

print.h 数据格式化打印函数

void print(plink p){
     char part[20],model[20],mfts[20],name[20];
     printf("               | %2d,",p->time.month);
     if(p->time.day<=9)//统一格式(若数值小于10,则打印0X)                      
          printf("0");     
printf("%d ",p->time.day);
     if(p->time.hour<=9)         
          printf("0");     
     printf("%d:",p->time.hour);
     if(p->time.minute<=9)         
          printf("0");     
     printf("%d ",p->time.minute);
     switch_int_to_name(4,p->part,part);
     switch_int_to_name(5,p->model,model);
     switch_int_to_name(1,p->mfts,mfts);
     switch_int_to_name(1,p->name,name);
     printf("|%10s|%11s|%10s|%10.2f|%7d|%11.2f|%10s|\n",part,model,mfts,p->unit,p->num,p->total,name);
 }

点赞

发表评论