- Опуликовал: admin
- |
- Коментариев: 0
- |
- Просмотров: 465

Решите ребус: korova+trava+doyrka=moloko
#include
main()
{
int k,o,r,v,a,t,d,y,m,l,korova,trava,doyarka,moloko;
for(k=1; k<10; k++)
for(o=0; o<10; o++)
if(k!=o) {
for(r=0; r<10; r++)
if((k!=r) and (o!=r)) {
for(v=0; v<10; v++)
if(((v!=k) and (v!=o) and (v!=r))) {
for(a=0; a<10; a++)
if((k!=a) and (o!=a) and (r!=a) and (v!=a)) {
for(t=1; t<10; t++)
if((t!=k) and (t!=o) and (t!=r) and (t!=v) and (t!=a)) {
for(d=1; d<10; d++)
if((d!=k) and (d!=o) and (d!=r) and (d!=v) and (d!=a) and (d!=t)) {
for(y=0; y<10; y++)
if((y!=k) and (y!=o) and (y!=r) and (y!=v) and (y!=a) and (y!=t) and (y!=d)) {
for(m=1; m<10; m++)
if((m!=k) and (m!=o) and (m!=r) and (m!=v) and (m!=a) and (m!=t) and (m!=d) and (m!=y)) {
{ for(l=0; l<10; l++)
if((l!=k) and (l!=o) and (l!=r) and (l!=v) and (l!=a) and (l!=t) and (l!=d) and (l!=y)and (l!=m)) {
korova=k*100000+o*19000+r*1000+o*100+v*10+a;
trava=t*10000+r*1000+a*100+v*10+a;
doyarka=d*100000+o*10000+y*1000+r*100+k*10+a;
moloko=m*100000+o*10000+l*1000+o*100+k*10+o;
if(korova+trava+doyarka==moloko){
printf("%d+%d+%d=%d ",korova,trava,doyarka,moloko); }}}}}}}}}}}}
ответ: 176498+20898+546018=743414
576498+20898+146058=743454
#include
main()
{
int k,o,r,v,a,t,d,y,m,l,korova,trava,doyarka,moloko;
for(k=1; k<10; k++)
for(o=0; o<10; o++)
if(k!=o) {
for(r=0; r<10; r++)
if((k!=r) and (o!=r)) {
for(v=0; v<10; v++)
if(((v!=k) and (v!=o) and (v!=r))) {
for(a=0; a<10; a++)
if((k!=a) and (o!=a) and (r!=a) and (v!=a)) {
for(t=1; t<10; t++)
if((t!=k) and (t!=o) and (t!=r) and (t!=v) and (t!=a)) {
for(d=1; d<10; d++)
if((d!=k) and (d!=o) and (d!=r) and (d!=v) and (d!=a) and (d!=t)) {
for(y=0; y<10; y++)
if((y!=k) and (y!=o) and (y!=r) and (y!=v) and (y!=a) and (y!=t) and (y!=d)) {
for(m=1; m<10; m++)
if((m!=k) and (m!=o) and (m!=r) and (m!=v) and (m!=a) and (m!=t) and (m!=d) and (m!=y)) {
{ for(l=0; l<10; l++)
if((l!=k) and (l!=o) and (l!=r) and (l!=v) and (l!=a) and (l!=t) and (l!=d) and (l!=y)and (l!=m)) {
korova=k*100000+o*19000+r*1000+o*100+v*10+a;
trava=t*10000+r*1000+a*100+v*10+a;
doyarka=d*100000+o*10000+y*1000+r*100+k*10+a;
moloko=m*100000+o*10000+l*1000+o*100+k*10+o;
if(korova+trava+doyarka==moloko){
printf("%d+%d+%d=%d ",korova,trava,doyarka,moloko); }}}}}}}}}}}}
ответ: 176498+20898+546018=743414
576498+20898+146058=743454