#include<stdio.h>
int main()
{
int t,n,i,str[4];
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
int sum=0;
while(n--)
{
int item=0;
scanf("%d%d%d%d",&str[1],&str[2],&str[3],&str[4]);
if(str[1]<60||str[2]<60||str[3]<60||str[4]<60)
item=1;
sum+=item;
}
printf("%d\n",sum);
}
return 0;
}
将其中的item的定义改为static int item;然后输入几组数据后 累加就会出错(多加了)
例如输入1(回车)4(回车)88 88 88 55(回车)88 88 88 59(回车)88 88 88 88(回车)88 55 88 88(回车) 到这里就会输出一个值 没有用static定义的输出的值是3 用static定义的输出的值是4 求解释喔