1.
#include <iostream>
using namespace std;
int main()
{
int A[100][100], i, j, n, m, suma=0;
cin>>n>>m;
for(i=1;i<=n;i++)
{
for(j=1;j<=m;j++)
{
cin>>A[i][j];
}
}
for(i=2;i<=n;i+=2)
{
for(j=2;j<m;j+=2)
{
suma = A[i-1][j-1] + A[i-1][j] + A[i-1][j+1] + A[i][j-1] + A[i][j+1] +
+ A[i+1][j-1] + A[i+1][j] + A[i+1][j+1];
cout<<suma<<" ";
}
}
}
2. Nu-mi dau seama cum se opreste programul din scris un cuvant. La baza sta urmatorul lucru: for(i=0;i<strlen(A);i++)
{
for(j=0;j<strlen(B);j++)
{
if (B[j] == A[i]) cnt++;
}
}
if cnt == strlen(A)