OJ-Problems-Source/HDOJ/2560_autoAC.cpp
2016-08-22 00:30:27 +08:00

19 lines
305 B
C++

#include <stdio.h>
int main()
{
int i,c,s,m,n,t;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&m,&n);
s = 0;
for(i=0;i<m*n;i++)
{
scanf("%d",&c);
if(c) s += c;
}
printf("%d\n",s);
}
return 0;
}