/*Nama :Muhammad Amin
*Nim :12010310056
*MK :SDA1
*Dosen :
*Program ke :3
*Tanggal :1 Oct 2015
*/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int send,more,money;
for(int s=0;s<=9;s++)
{
for(int e=0;e<=9;e++)
{
for(int n=0;n<=9;n++)
{
for(int d=0;d<=9;d++)
{
for(int m=0;m<=9;m++)
{
for(int o=0;o<=9;o++)
{
for(int r=0;r<=9;r++)
{
for(int y=0;y<=9;y++)
{
send=s*1000+e*100+n*10+d*1;
more=m*1000+o*100+r*10+e*1;
money=m*10000+o*1000+n*100+e*10+y*1;
if((send+more==money) && (s!=e) && (s!=n) && (s!=d) && (s!=m) && (s!=o) && (s!=r) && (s!=y) && (e!=n) && (e!=d) && (e!=m) && (e!=o) && (e!=r) && (e!=y) && (n!=d) && (n!=m) && (n!=o) && (n!=r) && (n!=y) && (d!=m) && (d!=o) && (d!=r) && (d!=y) && (m!=o) && (m!=r) && (m!=y) && (o!=r) && (o!=y) && (r!=y))
{
cout<< "SEND= "<<send<<" MORE= "<<more<<" MONEY= "<<money<<endl;
cout<<endl;
cout<< "SEND + MONEY= "<<send + more<<" : "<< money<< "= MONEY"<<endl;
cout<<endl;
cout<<m<<endl;
cout<<endl;
}
}
}
}
}
}
}
}
}
}
Senin, 14 Desember 2015
SEND+MORE+MONEY
Senin, Desember 14, 2015
No comments
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar