|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,d,e,f,sum;
sum=12;
for(a=1;a<=6;a++)
for(b=1;b<=6;b++)
for(c=1;c<=6;c++)
for(d=1;d<=6;d++)
for(e=1;e<=6;e++)
for(f=1;f<=6;f++)
if(a!=b && a!=c && a!=d && a!=e && a!=f
&& b!=c && b!=d && b!=e && b!=f
&& c!=d && c!=e && c!=f
&& d!=e && d!=f
&& e!=f )
if(sum==a+b+c && sum==c+d+e && sum==e+f+a)
printf("%d+%d+%d=%d+%d+%d=%d+%d+%d=%d\n",a,b,c,c,d,e,e,f,a,sum);
system("pause");
return 0;
}
|
|