纯暴力
#include <iostream>#include <cstring>#include <string>#include <vector>#include <queue>#include <cstdio>#include <set>#include <cmath>#include <algorithm>#include <queue>#define INF 0x3f3f3f3f#define MAXN 100005#define Mod 10001using namespace std;int main(){ int cnt=0; for(int a=1; a<=9; ++a) for(int b=1; b<=9; ++b) for(int c=1; c<=9; ++c) for(int d=1; d<=9; ++d) for(int e=1; e<=9; ++e) { if(a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=d&&b!=e&&c!=d&&c!=e&&d!=e) { int x=(a*10+b)*(c*100+d*10+e); int y=(a*100+d*10+b)*(c*10+e); if(x==y) { cnt++; cout<<a<<b<<" "<<c<<d<<e<<"="<<x<<endl; cout<<a<<d<<b<<" "<<c<<e<<"="<<y<<endl<<endl; } } } cout<<cnt<<endl; return 0;}新闻热点
疑难解答
图片精选