C语言程序设计(苏小红著)课后习题答案下载

时间:2017-04-12 11:07:06 C语言答案 我要投稿

C语言程序设计(苏小红著)课后习题答案下载

  C语言是一种计算机程序设计语言。它既有高级语言的.特点,又具有汇编语言的特点。以下是由阳光网小编整理关于C语言程序设计(苏小红著)课后习题答案下载地址,希望大家喜欢!

  点击进入:C语言程序设计(苏小红著)课后习题答案下载

  C语言程序设计(苏小红著)课后习题答案预览

  12.1 #include<stdio.h>

  typedef struct data

  {

  int year;

  int month;

  int day;

  }DATA;

  typedef struct work

  {

  char a[14];

  char b[10];

  char c[6];

  }WORK;

  typedef struct student

  {

  char studentName[10];

  char studentSex;

  DATA birthday;

  WORK profession;

  }STUDENT;

  int main()

  {

  STUDENT stu={"王刚",'M',{1991,5,19},{"信息工程系","学习人员","学生"}};

  printf("stu:%2s%3c%6d/%02d/%02d%4s,%4s,%4s\n",stu.studentName,stu.studentSex,stu.bi

  rthday.year,stu.birthday.month,stu.birthday.day,

  stu.profession.a,stu.profession.b,stu.profession.c);

  return 0;

  }

  12.4 #include<stdio.h>

  #include<string.h>

  #define N 10

  typedef struct people

  {

  char peopleName[10];

  }PEOPLE;

  int main()

  {

  int sum1=0,sum2=0,sum3=0,sum4=0;

  int i;

  char name[N][N];

  PEOPLE stu[5]={"zhang","li","wang"};

  printf("Enter their name:\n");

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

  {

  gets(name[i]);

  if(strcmp(name[i],stu[0].peopleName)==0)

  sum1++;

  else if(strcmp(name[i],stu[1].peopleName)==0)

  sum2++;

  else if(strcmp(name[i],stu[2].peopleName)==0)

  sum3++;

  else

  sum4++;

  }

  printf("stu:%4s%2d\n",stu[i].peopleName,sum[j]);

  printf("stu:%4s%2d\n",stu[1].peopleName,sum2);

  printf("stu:%4s%2d\n",stu[2].peopleName,sum3);

  printf("%2d\n",sum4);

  return 0;

  }


【C语言程序设计(苏小红著)课后习题答案下载】相关文章:

1.C语言程序设计(苏小红著)课后习题答案下载

2.C语言程序设计(苏小红著)课后答案下载

3.《C语言程序设计》苏小红著课后答案

4.C语言程序设计(苏小红著)课后习题第八章答案

5.C语言程序设计(方风波著)课后习题答案下载

6.C语言程序设计(杨勇著)课后答案下载

7.C语言程序设计(何钦铭著)课后习题答案下载

8.C语言程序设计(陈明晰著)课后答案下载