C 语言结构体

  struct Student{
      int num;
      char name[20];
      char sex;
      int age;
      float score;
      char addr[30];
  };
  
  int main()
  {
     struct Student s={1001,"lele",‘M‘,20,98.5,"Shanghai"};
      struct Student sArr[3];
      int i;
      for (i=0;i<3;++i)
          scanf("%d%s %c%d%f%s",&sArr[i].num,sArr[i].name,&sArr[i].sex,&sArr[i].age,&sArr[i].score,sArr[i].addr);
      for (i=0;i<3;++i)
          printf("%d %s %c %d %5.2f %s\n",sArr[i].num,sArr[i].name,sArr[i].sex,sArr[i].age,sArr[i].score,sArr[i].addr);
      return 0;                                                                                                                       
  }

C 语言结构体

上一篇:Selecting Contents for Uber JAR


下一篇:springboot常用任务