#include <iostream>
void main()
{
int x;
std::cin>>x;
int sum = 0;
int prod = 1;
while(x>0)
int y = x%10;
sum = sum + y;
prod = prod * y;
x=x/10;
}
if(sum%10 == 0 && prod < 100)
std::cou<<"Yes"<<endl;
else:
std::cout<<"No"<<endl;
Pascal
var n,digit,sum,prod:integer;
begin
readln(n);
sum = 0;
prod = 1;
while (n>0) do
digit:=n mod 10;
sum = sum+digit;
prod = prod * digit;
n:=n div 10;
end;
if(sum mod 10=0)and(prod<100)
writeln("да");
end
else
writeln("Нет"):
Как то так
end.
С++
int mass [5][5];
for (int i=0; i<5;i++)
for(int j=0; j<5l; j++)
mass[i][j]=rand()*20-10;
int pn [2];
int nn [2];
for(int i=0; i<5; i++)
for(int j=i+1; j<5; j++)
if (mass[i][j]>0)
pn[0]=i;
pn[1]=j;
break();
for(int i=4; i>=0; i--)
for(int j=i-1; j>=0; j--)
if(mass[i][j]<0)
nn[0]=i;
nn[i]=j;
swap(mass[pn[0]] [pn[1]], mass [nn[0]] [nn[1]]);
#include <iostream>
void main()
{
int x;
std::cin>>x;
int sum = 0;
int prod = 1;
while(x>0)
{
int y = x%10;
sum = sum + y;
prod = prod * y;
x=x/10;
}
if(sum%10 == 0 && prod < 100)
std::cou<<"Yes"<<endl;
else:
std::cout<<"No"<<endl;
}
Pascal
var n,digit,sum,prod:integer;
begin
readln(n);
sum = 0;
prod = 1;
while (n>0) do
begin
digit:=n mod 10;
sum = sum+digit;
prod = prod * digit;
n:=n div 10;
end;
if(sum mod 10=0)and(prod<100)
begin
writeln("да");
end
else
begin
writeln("Нет"):
end;
Как то так
end.
С++
#include <iostream>
void main()
{
int mass [5][5];
for (int i=0; i<5;i++)
for(int j=0; j<5l; j++)
mass[i][j]=rand()*20-10;
int pn [2];
int nn [2];
for(int i=0; i<5; i++)
for(int j=i+1; j<5; j++)
if (mass[i][j]>0)
{
pn[0]=i;
pn[1]=j;
break();
}
for(int i=4; i>=0; i--)
for(int j=i-1; j>=0; j--)
if(mass[i][j]<0)
{
nn[0]=i;
nn[i]=j;
break();
}
swap(mass[pn[0]] [pn[1]], mass [nn[0]] [nn[1]]);
}