Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- char matriz[1000][1000];
- int x, y, nl, nc, count=0, count1=0;
- scanf("%d %d", &nl, &nc);
- if(nl<0 || nl>1000 || nc<0 || nc>1000) return 0;
- for(x=0; x<nl; x++) scanf("%s", &matriz[x][0]);
- for(x=0; x<nl; x++) {
- for(y=0; y<nc; y++) {
- if(matriz[x][y]=='#') {
- if(matriz[x][y+1] == '.' || matriz[x][y-1] == '.' || matriz[x+1][y] == '.' || matriz[x-1][y] || '.') count++; } } }
- printf("%d", count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement