rxu2003 @ 2023-03-08 23:35:51
# include <stdio.h>
int main ( )
{
int gd[10] = {0};
int sg = 0;
int js = 1;
scanf ("%d%d%d%d%d%d%d%d%d%d",&gd[0],&gd[1],&gd[2],&gd[3],&gd[4],&gd[5],&gd[6],&gd[7],&gd[8],&gd[9]);
scanf ("%d",&sg);
for (int n=0; n<10; n++)
{
if (sg>gd[n] || sg+30>gd[n])
js++;
}
printf ("%d\n",js);
return 0;
}
by AndyPomeloMars @ 2023-03-09 06:23:04
@rxu2003 为什么
by rxu2003 @ 2023-03-09 12:37:41
@AndyPomeloMars 谢谢,是我钻牛角尖了,没思考透彻
by QiYingzhen123 @ 2023-04-20 17:57:53
@rxu2003 你前面sg赋值为0,后面为什么还要输入sg?
by rxu2003 @ 2023-04-21 18:21:59
@QiYingzhen123 ```c
int sg = 0;//就是进行一个初始化,我自己个人习惯将定义的变量都进行初始化【狗头】