Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- char mas[1000][1000];
- int main()
- {
- int j=0;
- int i=0;
- int M=0;
- int N=0;
- int kol=0;
- cin>>M;
- cin>>N;
- for(i=0;i<M;i++){
- for(j=0;j<N;j++){
- cin>>mas[i][j];
- }
- }
- for(i=0;i<M;i++){
- for(j=0;j<N;j++){
- cout<<mas[i][j];
- }
- cout<<"\n";
- }
- for(i=0;i<M;i++){
- for(j=0;j<N;j++){
- if(mas[i][j]=='.'&&mas[i][j+1]=='.'){
- kol++;
- }
- }
- }
- for(i=0;i<N;i++){
- for(j=0;j<M;j++){
- if(mas[j][i]=='.'&&mas[j+1][i]=='.'){
- kol++;
- }
- }
- }
- cout<<kol;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement