Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- long long a1,b1,i,j,c;
- char a[10001];
- int main()
- {
- cin >> a1 >> b1;
- for(i=1;i<=a1;i++){
- for(j=1;j<=b1;j++){
- cin >> a[i,j];
- }
- }
- for(i=1;i<=a1;i++){
- for(j=1;j<=b1;j++){
- if(a[i,j]=='.' && a[i+1,j]!='*' && a[i,j+1]!='*' && a[i-1,j]!='*' && a[i,j-1]!='*') c++;
- }
- }
- cout << c;
- }
- /*4x4
- . . . .
- . . . .
- . . . .
- . . . .*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement