Rss
Виртуальный кабинет МАТЕМАТИКУС
Популярное
Календарь
«     2024    »
1234567
891011121314
15161718192021
22232425262728
2930 
Журнал "Математика"
Математика
Счетчик посещений
счетчик посещений
Flag Counter

Опросы
Оцените работу сайта
Лучший
Неплохой
Устраивает ... но ...
Встречал и получше
Совсем не понравился

Интернет с пользой
Интернет с пользой
  • Опуликовал: admin
  • |
  • Коментариев: 0
  • |
  • Просмотров: 370
РЕШИ+ЕСЛИ=СИЛЕН
#include
main()
{
int r,e,sh,i,s,l,n,reshi,esli,silen;
for(r=1; r<10; r++)
for(e=1; e<10; e++)
if(r!=e) {
for(sh=0; sh<10; sh++)
if((sh!=r) and (sh!=e)) {
for(i=0; i<10; i++)
if((i!=r) and (i!=e) and (i!=sh)) {
for(s=1; s<10; s++)
if((s!=r) and (s!=e) and (s!=sh) and (s!=i) ) {
for(l=0; l<10; l++)
if((l!=r) and (l!=e) and (l!=sh) and (l!=i) and (l!=s)) {
for(n=0; n<10; n++)
if((n!=r) and (n!=e) and (n!=sh) and (n!=i) and (n!=s) and (n!=l)) {
reshi=r*1000+e*100+sh*10+i;
esli=e*1000+s*100+l*10+i;
silen=s*10000+i*1000+l*100+e*10+n;
if(reshi+esli==silen){
printf("%d+%d=%d \n",reshi,esli,silen); }}}}}}}}
Ответ:
5782+7192=12974
9382+3152=12534
9675+6185=15860

Облако Тегов

{links}