Untitled

mail@pastecode.io avatarunknown
plain_text
2 months ago
599 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main(){
	freopen("input.txt","r",stdin);
	int T;
	for (T = 0; T < 10; T++){
		int T1;
		cin>>T1;
		int A[100][100];
		int i,j,t;
		for (i = 0; i < 100; i++)
			for (j = 0; j < 100; j++)
				cin>>A[i][j];
		int dem =0;
		for (j = 0; j < 100; j++){
			for (i = 0; i < 100; i++){
				if (A[i][j] == 1){
					t = i;
					while (t < 99){
						if (A[t+1][j]==1)
							A[t+1][j]= 0;
						if (A[t+1][j]==2){
							dem++;
							break;
						}
						t++;
					}
				}
			}
		}
		cout<<"#"<<T+1<<" "<<dem<<endl;
	}
	return 0;
}