Відповідь:
Пояснення:
#include<iostream>
using namespace std;
const int n=5;
void input(int a[n][n]);
void print(int a[n][n]);
void trans(int a[n][n]);
int main()
{
int m[n][n];
input(m);
print(m);
trans(m);
print(m);
return 0;
}
void print(int a[n][n])
{
cout<<"matrica:\n";
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cout<<a[i][j]<<" ";
}
cout<<endl;
}
cout<<endl;
}
void input(int a[n][n])
{
cout<<"vvedi matricu:\n";
for(int i=0; i<n; i++)
{
for(int j=0; j<n; j++)
{
cin>>a[i][j];
}
}
}
void trans(int a[n][n])
{
int temp;
for(int i=0;i<n;i++)
{
for(int j=0;j<i;j++)
{
temp=a[i][j];
a[i][j]=a[j][i];
a[j][i]=temp;
}
}
}
Решение ⇒
Листинг программы + скриншот, дабы показать должные табуляции:
print('Задайте возраст Антона, Виктора и Бориса по порядку:')
a, b, c = input().split()
if b==a and c<b:
print('Борис - самый младший из троих, возрасты остальных равны')
elif a==c and b<a:
print('Виктор - самый младший из троих, возрасты остальных равны')
elif c==b and a<c:
print('Антон - самый младший из троих, возрасты остальных равны')
elif a>b and a>c :
print('Антон - самый старший из троих')
elif a<b and c<b:
print('Виктор - самый старший из троих')
elif a==b and b==c:
print('Same age')
elif a<c and b<c:
print('Борис - самый старший из троих')
for b in range(0,10):
for c in range(0,10):
for d in range(0,10):
if(a != b and b != c and c != d and a != c and b != d & a != d):
if(a * b - c * d == a + b + c + d):
print(str(a) + str(b) + str(c) + str(d));