Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int V[10000];
- int main() {
- int colunas, linhas, x, i, j, lido;
- while (1) {
- scanf("%d %d %d", &colunas, &linhas, &x);
- if (colunas == 0 && linhas == 0 && x == 0) break;
- for (j = 0; j < colunas; j++) {
- V[j] = 0;
- }
- int qt = 0;
- for (i = 0; i < linhas; i++) {
- for (j = 0; j < colunas; j++) {
- scanf("%d", &lido);
- if (lido == 1) {
- V[j]++;
- } else {
- if (V[j] >= x) {
- qt++;
- }
- V[j] = 0;
- }
- }
- }
- for (j = 0; j < colunas; j++) {
- if (V[j] >= x)
- qt++;
- }
- printf("%d\n", qt);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement