ამოხსნების სტატუსი

ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.


გაგზავნის თარიღი: 21.01.2023 13:46:56

ამოცანა: სატელიტური ფოტო

მომხმარებელი: Mimimetreveli12

ვერდიქტი: ამოუხსნელი

შეფასება: 0 ქულა







#include <iostream>
using namespace std;
int n.m,c,ma;
char p[1000][1000];
void f(int a, int b) 
{
	c++;
	p[a][b]='.';
	if (p[a][b+1]=='*') f(a,b+1);
	if (p[a][b-1] == '*') f(a,b-1);
	if (p[a+1][b] == '*') f(a+1,b);
	if (p[a-1][b] == '*') f(a-1,b);
}
int main() 
{
	cin>>n>>m;
	for (int i=1; i<=n; i++)
	 for (int j=1; j<=m; j++) 
	  cin >> p[i][j];
	for (int i=1; i<=n; i++) 
	 for (int j=1; j<=m; j++) 
	  if (p[i][j] == '*') { f(i,j);
				             if (c>ma) ma=c;
				             c=0;}
	cout<<ma;
}
main.cpp:3:6: error: expected initializer before '.' token
 int n.m,c,ma;
      ^
main.cpp: In function 'void f(int, int)':
main.cpp:7:2: error: 'c' was not declared in this scope
  c++;
  ^
main.cpp: In function 'int main()':
main.cpp:16:7: error: 'n' was not declared in this scope
  cin>>n>>m;
       ^
main.cpp:16:10: error: 'm' was not declared in this scope
  cin>>n>>m;
          ^
main.cpp:23:22: error: 'c' was not declared in this scope
                  if (c>ma) ma=c;
                      ^
main.cpp:23:24: error: 'ma' was not declared in this scope
                  if (c>ma) ma=c;
                        ^~
main.cpp:24:18: error: 'c' was not declared in this scope
                  c=0;}
                  ^
main.cpp:25:8: error: 'ma' was not declared in this scope
  cout<<ma;
        ^~