|
第一题:
#include <iostream.h>
void main()
{
cout<<"********1"<<'\n';
cout<<"*******121"<<'\n';
...
cout<<"12345678987654321";
}
第二题:
#include <iostream.h>
void main()
{
int e,f,i,n,s,t,x;
long x1,x2,y;
for(e=0;e<=9;e++)
{
for(f=0;f<=9;f++)
{
for(i=0;i<=9;i++)
{
for(n=0;n<=9;n++)
{
for(s=0;s<=9;s++)
{
for(t=0;t<=9;t++)
{
for(x=0;x<=9;x++)
{
x1=1010000*f+100000*i+1000*t+110*e+n;
x2=100*t+10*e+n;
y=1000000*s+100000*i+10000*x+1000*t+110*e+n;
if((x1+2*x2)==y)
{
cout<<"e= "<<e<<'\n';
cout<<"f= "<<f<<'\n';
cout<<"i= "<<i<<'\n';
cout<<"n= "<<n<<'\n';
cout<<"s= "<<s<<'\n';
cout<<"t= "<<t<<'\n';
cout<<"x= "<<x<<'\n';
break;
}
}
}
}
}
}
}
}
}
- -!!! |
|