ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.
გაგზავნის თარიღი: 24.01.2023 20:48:45
ამოცანა: გუბურების დათვლა
მომხმარებელი: giogumb
ვერდიქტი: ამოუხსნელი
შეფასება: 0 ქულა
using namespace std; int n,m,i,j,k; char a[105][105]; int eras(int x, int y){ a[x][y]='.'; if (a[x+1][y]=='W') eras(x+1,y); if (a[x+1][y+1]=='W') eras(x+1,y+1); if (a[x][y+1]=='W') eras(x,y+1); if (a[x-1][y+1]=='W') eras(x-1,y+1); if (a[x-1][y]=='W') eras(x-1,y); if (a[x-1][y-1]=='W') eras(x-1,y-1); if (a[x][y-1]=='W') eras(x,y-1); if (a[x+1][y-1]=='W') eras(x+1,y-1); } int main(){ cin>>n>>m; for (i=1; i<=n;i++){ for (j=1; j<=m; j++){ cin>>a[i][j];}} for (i=1; i<=n;i++){ for (j=1; j<=m; j++){ if (a[i][j]=='W') {k++; eras(i,j);} }} cout<<k<<endl; }
main.cpp: In function 'int main()': main.cpp:20:5: error: 'cin' was not declared in this scope cin>>n>>m; ^~~ main.cpp:29:2: error: 'cout' was not declared in this scope cout<<k<<endl; ^~~~ main.cpp:29:11: error: 'endl' was not declared in this scope cout<<k<<endl; ^~~~