华中科技大学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}};
總結
以上是生活随笔為你收集整理的华中科技大学c语言作业答案,华中科技大学标准C语言程序设计及应用习题答案...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c语言void replace(str,
- 下一篇: 二级c语言上机编程技巧,二级C语言上机编