300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > 华中科技大学c语言作业答案 华中科技大学标准C语言程序设计及应用习题答案...

华中科技大学c语言作业答案 华中科技大学标准C语言程序设计及应用习题答案...

时间:2022-10-24 16:31:48

相关推荐

华中科技大学c语言作业答案 华中科技大学标准C语言程序设计及应用习题答案...

结构体

2.

#include

#define N 3

struct a

{

long num;

char name[20];

int old; //工龄

char ps[20]; //职务

int wage;

};

main()

{

struct a b[N];

int i,sum=0,ave=0;

for(i=0;i

{

scanf("%ld%s%d%s%d",&b[i].num,b[i].name,&b[i].old,b[i].ps,&b[i].wage); sum=sum+b[i].wage;

}

ave=sum/N;

printf("工作证号 姓名 工龄 职务 工资\n");

printf("-----------------------------\n");

for(i=0;i<3;i++)

printf("%-9ld%-5s%-5d%-5s%-5d\n",b[i].num,b[i].name,b[i].old,b[i].ps,b[i].wage); printf("总工资=%d\t平均工资=%d\n",sum,ave);

}

7.

#include

struct Date

{

int day;

int month;

int year;

int yearday;

char month_name[4];

};

Int day_of_year(struct Date pd)

{

Int day_tab[2][13]=

{{0,31,28,31,30,31,30,31,31,30,31,30,31}

{0,31,29,31,30,31,30,31,31,30,31,30,31}};

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。