问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

C语言的结构类型

发布网友 发布时间:2022-04-29 17:15

我来回答

3个回答

热心网友 时间:2023-10-22 16:13

修改如下:

//---------------------------------------------------------------------------

#include<stdio.h>
#include <conio.h>/*用到了getch()函数*/
struct date{
int month;
int day;
int year;
};
struct student{
long number;
char name[80];/*应该定义为字符数组*/
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");
gets(stud.name);/*gets()函数的参数是个字符指针,而不是字符变量*/
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&stud.score[0],&stud.score[1],&stud.score[2]);/*注意这里*/
printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}
//---------------------------------------------------------------------------

热心网友 时间:2023-10-22 16:14

name 是个 char.所以只能输入一个字符

#include<stdio.h>
#include<conio.h>
struct date
{
int month;
int day;
int year;
};
struct student
{
long number;
char name[200];
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number = 10001L;
printf("Please input the name:");
gets(stud.name);
stud.birthday.year = 1981;
stud.birthday.year++;
stud.birthday.month = 8;
stud.birthday.day = 12;
stud.sex = 'm';
printf("Please input the score:");
scanf("%d %d %d", &score[0], &score[1], &score[2]);
printf("%d%s%c\n", stud.number, stud.name, stud.sex);
printf("birthday:%d-%d-%d\n", stud.birthday.month, stud.birthday.day, stud.birthday.year);
printf("score;%d,%d,%d", stud.score[0], stud.score[1], stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:14

int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");

gets(stud.name); //这里要改成gets(&(stud.name))
~~~~~~~~~~~~~~~
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&score[0],&score[1],&score[2]); printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:13

修改如下:

//---------------------------------------------------------------------------

#include<stdio.h>
#include <conio.h>/*用到了getch()函数*/
struct date{
int month;
int day;
int year;
};
struct student{
long number;
char name[80];/*应该定义为字符数组*/
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");
gets(stud.name);/*gets()函数的参数是个字符指针,而不是字符变量*/
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&stud.score[0],&stud.score[1],&stud.score[2]);/*注意这里*/
printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}
//---------------------------------------------------------------------------

热心网友 时间:2023-10-22 16:14

name 是个 char.所以只能输入一个字符

#include<stdio.h>
#include<conio.h>
struct date
{
int month;
int day;
int year;
};
struct student
{
long number;
char name[200];
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number = 10001L;
printf("Please input the name:");
gets(stud.name);
stud.birthday.year = 1981;
stud.birthday.year++;
stud.birthday.month = 8;
stud.birthday.day = 12;
stud.sex = 'm';
printf("Please input the score:");
scanf("%d %d %d", &score[0], &score[1], &score[2]);
printf("%d%s%c\n", stud.number, stud.name, stud.sex);
printf("birthday:%d-%d-%d\n", stud.birthday.month, stud.birthday.day, stud.birthday.year);
printf("score;%d,%d,%d", stud.score[0], stud.score[1], stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:14

int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");

gets(stud.name); //这里要改成gets(&(stud.name))
~~~~~~~~~~~~~~~
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&score[0],&score[1],&score[2]); printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:13

修改如下:

//---------------------------------------------------------------------------

#include<stdio.h>
#include <conio.h>/*用到了getch()函数*/
struct date{
int month;
int day;
int year;
};
struct student{
long number;
char name[80];/*应该定义为字符数组*/
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");
gets(stud.name);/*gets()函数的参数是个字符指针,而不是字符变量*/
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&stud.score[0],&stud.score[1],&stud.score[2]);/*注意这里*/
printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}
//---------------------------------------------------------------------------

热心网友 时间:2023-10-22 16:14

name 是个 char.所以只能输入一个字符

#include<stdio.h>
#include<conio.h>
struct date
{
int month;
int day;
int year;
};
struct student
{
long number;
char name[200];
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number = 10001L;
printf("Please input the name:");
gets(stud.name);
stud.birthday.year = 1981;
stud.birthday.year++;
stud.birthday.month = 8;
stud.birthday.day = 12;
stud.sex = 'm';
printf("Please input the score:");
scanf("%d %d %d", &score[0], &score[1], &score[2]);
printf("%d%s%c\n", stud.number, stud.name, stud.sex);
printf("birthday:%d-%d-%d\n", stud.birthday.month, stud.birthday.day, stud.birthday.year);
printf("score;%d,%d,%d", stud.score[0], stud.score[1], stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:14

int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");

gets(stud.name); //这里要改成gets(&(stud.name))
~~~~~~~~~~~~~~~
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&score[0],&score[1],&score[2]); printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:13

修改如下:

//---------------------------------------------------------------------------

#include<stdio.h>
#include <conio.h>/*用到了getch()函数*/
struct date{
int month;
int day;
int year;
};
struct student{
long number;
char name[80];/*应该定义为字符数组*/
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");
gets(stud.name);/*gets()函数的参数是个字符指针,而不是字符变量*/
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&stud.score[0],&stud.score[1],&stud.score[2]);/*注意这里*/
printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}
//---------------------------------------------------------------------------

热心网友 时间:2023-10-22 16:14

name 是个 char.所以只能输入一个字符

#include<stdio.h>
#include<conio.h>
struct date
{
int month;
int day;
int year;
};
struct student
{
long number;
char name[200];
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number = 10001L;
printf("Please input the name:");
gets(stud.name);
stud.birthday.year = 1981;
stud.birthday.year++;
stud.birthday.month = 8;
stud.birthday.day = 12;
stud.sex = 'm';
printf("Please input the score:");
scanf("%d %d %d", &score[0], &score[1], &score[2]);
printf("%d%s%c\n", stud.number, stud.name, stud.sex);
printf("birthday:%d-%d-%d\n", stud.birthday.month, stud.birthday.day, stud.birthday.year);
printf("score;%d,%d,%d", stud.score[0], stud.score[1], stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:13

修改如下:

//---------------------------------------------------------------------------

#include<stdio.h>
#include <conio.h>/*用到了getch()函数*/
struct date{
int month;
int day;
int year;
};
struct student{
long number;
char name[80];/*应该定义为字符数组*/
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");
gets(stud.name);/*gets()函数的参数是个字符指针,而不是字符变量*/
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&stud.score[0],&stud.score[1],&stud.score[2]);/*注意这里*/
printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}
//---------------------------------------------------------------------------

热心网友 时间:2023-10-22 16:14

name 是个 char.所以只能输入一个字符

#include<stdio.h>
#include<conio.h>
struct date
{
int month;
int day;
int year;
};
struct student
{
long number;
char name[200];
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number = 10001L;
printf("Please input the name:");
gets(stud.name);
stud.birthday.year = 1981;
stud.birthday.year++;
stud.birthday.month = 8;
stud.birthday.day = 12;
stud.sex = 'm';
printf("Please input the score:");
scanf("%d %d %d", &score[0], &score[1], &score[2]);
printf("%d%s%c\n", stud.number, stud.name, stud.sex);
printf("birthday:%d-%d-%d\n", stud.birthday.month, stud.birthday.day, stud.birthday.year);
printf("score;%d,%d,%d", stud.score[0], stud.score[1], stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:14

int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");

gets(stud.name); //这里要改成gets(&(stud.name))
~~~~~~~~~~~~~~~
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&score[0],&score[1],&score[2]); printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:14

int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");

gets(stud.name); //这里要改成gets(&(stud.name))
~~~~~~~~~~~~~~~
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&score[0],&score[1],&score[2]); printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:13

修改如下:

//---------------------------------------------------------------------------

#include<stdio.h>
#include <conio.h>/*用到了getch()函数*/
struct date{
int month;
int day;
int year;
};
struct student{
long number;
char name[80];/*应该定义为字符数组*/
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");
gets(stud.name);/*gets()函数的参数是个字符指针,而不是字符变量*/
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&stud.score[0],&stud.score[1],&stud.score[2]);/*注意这里*/
printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}
//---------------------------------------------------------------------------

热心网友 时间:2023-10-22 16:14

name 是个 char.所以只能输入一个字符

#include<stdio.h>
#include<conio.h>
struct date
{
int month;
int day;
int year;
};
struct student
{
long number;
char name[200];
char sex;
struct date birthday;
int score[3];
};
int main(void)
{
int score[3];
struct student stud;
stud.number = 10001L;
printf("Please input the name:");
gets(stud.name);
stud.birthday.year = 1981;
stud.birthday.year++;
stud.birthday.month = 8;
stud.birthday.day = 12;
stud.sex = 'm';
printf("Please input the score:");
scanf("%d %d %d", &score[0], &score[1], &score[2]);
printf("%d%s%c\n", stud.number, stud.name, stud.sex);
printf("birthday:%d-%d-%d\n", stud.birthday.month, stud.birthday.day, stud.birthday.year);
printf("score;%d,%d,%d", stud.score[0], stud.score[1], stud.score[2]);
getch();
}

热心网友 时间:2023-10-22 16:14

int main(void)
{
int score[3];
struct student stud;
stud.number=10001L;
printf("Please input the name:");

gets(stud.name); //这里要改成gets(&(stud.name))
~~~~~~~~~~~~~~~
stud.birthday.year=1981;
stud.birthday.year++;
stud.birthday.month=8;
stud.birthday.day=12;
printf("Please input the score:");
scanf("%d%d%d",&score[0],&score[1],&score[2]); printf("%ld%s%4c\n",stud.number,stud.name,stud.sex);
printf("birthday:%d-%d-%d\n",stud.birthday.month,stud.birthday.day,stud.birthday.year);
printf("score;%d,%d,%d",stud.score[0],stud.score[1],stud.score[2]);
getch();
}
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
焦作有哪些旅行景点值得一去? 河南穿古装去的地方 AE入门从学会套模板开始,AE模板套用简易教程,看起来复杂的AE其实也很... ae怎么套用模板ae模版的使用方法 北京通州区有什么好玩的地方吗 请问现在有哪些看电影的网站?越多越好~~ 帮初中女儿请假一天讲身体不适,班主任却跟别的老师讲她得了大病,该如何... 梦见家中被盗空只剩一件绿色衣的预兆 梦见美丽沙穗 美版4s内置卡贴有什么危害? 12306买了学生票之后没有进行资质认证需要取消吗 求C语言常用和基本结构类型 12306不是学生买成了学生票? 2022大盘休市时间 12306错买学生票怎么办?能换成成人票吗? 不小心网上买成了学生票,可以改成普通票吗?如果可以,要怎么改? 把好友删除 没有 只有转账记录 怎么加回来 qq绑定的手机号换了该怎么办? wps 角标设置,如何去掉页面下方,如图 如图,WPS里文章结尾有一条横线,怎么都去不掉,删除不了也选不上。问一下怎么去掉? 苹果7刷机后恢复数据失败怎么办 怎么将苹果手机字体转换成隶书字体 iPhone8刷机失败提示无法恢复怎么办 360手机助手,腾讯手机管家,赠送保险,保单号在哪里查询? 下面圆圈上面一个向上箭头的符号(不是斜的)怎么打? sk2祛斑和美白的哪个 sk2面膜青春敷男友补水面膜和补水美白哪个好 怎么改QQ空间里的名字? 《 箭头朝上的符号怎么打? sk2美白面膜好用还是3D c语言的结构体类型 C语言中构造类型数据指什么? qq 发红包怎么取消实名验证 qq不能发红包需实名验证该怎么把实名验证去掉 女人每天游泳半小时,30天后,身体会发生哪些变化呢? 每天游泳2000米坚持3个月身体有何变化 大家都重视体育健身,那么坚持游泳两个月是什么体验? 坚持游泳5个月,身体有哪些变化?经常游泳应该注意什么? 长期游泳身体会有什么变化? 对于经常游泳的人来说,身材会出现哪些变化? 说说你游泳一段时间后的身体变化! 持续游泳1个月,会有什么惊人变化? 男性坚持游泳一个月,有哪些意想不到的变化,值得一看? 农商银行以前微信收款有奖金收入现在为什么没有? 游泳可以减肥吗?经常游泳身体会有什么变化? 炸茄盒的做法有哪些? 游泳一个月身材的变化 游泳能减肥吗 每天游泳半小时 2个月健康瘦18斤 微信累计收款金额超过100万会有什么好处? 我游泳了3个月,身体体重没有明显的变化,是我泳姿不对吗?