C语言注意

考场上注意

https://blog.csdn.net/C20180630/article/details/53158021

常用头文件

https://www.luogu.org/discuss/show/81561

https://blog.csdn.net/SBS2000/article/details/52756939

 

输入问题:

输入时 getchar()和scanf("%c", &a)会读取空格,所以要注意按照输入格式来

eg:

YaoLin 87 82 Y N 0
ChenRuiyi 88 78 N Y 1
LiXin 92 88 N N 0
ZhangQin 83 87 Y N 1
要用
scanf("%s %d %d %c %c %d",st[i].name,&st[i].exam_score,&st[i].class_score,&st[i].p,&st[i].s,&st[i].l);

而不能用

scanf("%s%d%d%c%c%d", st[i].name, &st[i].exam_score, &st[i].class_score, &st[i].p, &st[i].s, &st[i].l);

 

scanf读取字符问题:

https://blog.csdn.net/Tianweidadada/article/details/83020660

posted @ 2019-08-01 22:23  ATKevin  阅读(131)  评论(0)    收藏  举报