Check the meaning of the verbs in bold. then
look at photos 1-6 and choose the correct
verbs.
1 the blackbird is feeding / eating its chicks.
2 the beaver is digging / building a dam.
3 the chameleon is catching / helping an
insect with its tongue.
4 the fish is fighting / protecting the other
fish.
5 the bear is hunting / hiding the salmon.
6 a falcon is playing with / chasing a group of
smaller birds.
#include <stdio.h>
#include <windows.h>
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
int const n=3;
int mas[n][n];
int sum1, sum2;
bool magik;
for (int i=0; i<n; i++)
for (int j=0; j<n; j++)
{
printf("mas[%d][%d] = ", i+1, j+1);
scanf("%d",&mas[ i ][ j ]);
}
printf("\nВведенная матрица:\n");
for (int i=0; i<n; i++)
{
for (int j=0; j<n; j++)
{
printf("%d ",mas[ i ][ j ]);
}
printf("\n");
}
sum1=0;
sum2=0;
for (int i = 0; i<n; i++)
{
sum1 += mas[ i ][ i ];
sum2 += mas[ i ][ n-1-i ];
}
printf("Сумма главной диагонали = %d\n", sum1);
printf("Сумма побочной диагонали = %d\n", sum2);
magik = true;
for (int i=0; i<n; i++)
{
if (sum1==sum2)
{
sum2=0;
for (int j=0; j<n; j++)
{
sum2 += mas[ i ][ j ];
}
} else { magik=false; break; }
}
if (magik==true)
{
for (int i=0; i<n; i++)
{
if (sum1==sum2)
{
sum2=0;
for (int j=0; j<n; j++)
{
sum2 += mas[ j ][ i ];
}
}
else { magik=false; break; }
}
}
if (magik==true)
printf("\nМатрица является магическим квадратом\n");
else
printf("\nМатрица не является магическим квадратом\n");
system("pause");
return 0;
}