69,382
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <memory.h>
#include <unistd.h>
#include <ctype.h>
#include <pwd.h>
#include <fcntl.h>
#include <termios.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
typedef struct _IRDA_ELECT
{
char total[10];
char high[10];
char low[10];
}IRDA_ELECT;
typedef struct IRDA_ELECT * PIRDA_ELECT;
typedef struct _USRINFO
{
char prc_code[10];
char mr_sn[5 + 1];
}USRINFO;
typedef struct USRINFO * PUSRINFO;
typedef struct _FOUINFO
{
USRINFO usrinfo;
char a[2];
}FOUINFO;
typedef struct FOUINFO * PFOUINFO;
int price_cacl(IRDA_ELECT Irda_elect,PFOUINFO pFouinfo)
{
float flat;
flat = atof(Irda_elect.total)-atof(Irda_elect.high)-atof(Irda_elect.low);
printf("T is %s--H is %s--L is %s--F is %f\n",Irda_elect.total,Irda_elect.high,Irda_elect.low,flat);
printf("prc_code is %s\n",pFouinfo->usrinfo.prc_code);
}
main()
{
IRDA_ELECT Irda_elect;
FOUINFO Fouinfo;
memset(&Irda_elect,0x00,sizeof(IRDA_ELECT));
memset(&Fouinfo,0x00,sizeof(FOUINFO));
sprintf(Irda_elect.total,"%s","80");
sprintf(Irda_elect.high,"%s","20");
sprintf(Irda_elect.low,"%s","20");
sprintf(Fouinfo.usrinfo.prc_code,"%s","40101019");
price_cacl(Irda_elect,&Fouinfo);
}