当前位置:网站首页>Results fill in the blanks carelessly (violent solution)
Results fill in the blanks carelessly (violent solution)
2022-07-28 07:00:00 【White mouse zero】
Xiao Ming is an acute child , When I was in primary school, I often copied the questions that the teacher wrote on the blackboard wrong .
There is a , The teacher's question is :36 x 495 = ?
He was copied as :396 x 45 = ?
But it turned out to be dramatic , His answer turned out to be right !!
because 36 * 495 = 396 * 45 = 17820
There may be many such coincidences , such as :27 * 594 = 297 * 54
hypothesis a b c d e representative 1~9 Different 5 A digital ( Note that there are different numbers , And it doesn't include 0)
Can satisfy the shape as : ab * cde = adb * ce How many kinds of formulas are there in all ?
Please use the advantages of computer to find all the possibilities , And answer the kinds of numbers of different formulas .
There are different kinds of formulas satisfying the commutative law of multiplication , So the answer must be an even number .
answer
142
The problem solving process
To be honest, the choice of the blue bridge cup can be passed by the general violent solution , But it sometimes plays tricks ( Get some accuracy or something , Far away ). Here, the direct five fold cycle of violence is solved !
Attach code
#include<iostream>
using namespace std;
int main()
{
int counts=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 num1=(a*10+b)*(c*100+d*10+e);
int num2=(a*100+d*10+b)*(c*10+e);
if(num1==num2)
counts++;
}
}
}
}
}
}
cout<<counts<<endl;
return 0;
}
边栏推荐
- C language memcpy library functions and the role of memmove
- SSH service configuration
- shell脚本——正则表达式
- Which brand of air conduction earphones is good and highly praised
- LNMP搭建过程详解
- JS four operations are repackaged to solve the problem of precision loss
- Custom component -- communication between parent and child components
- Method of designing test cases
- Technology sharing | detailed explanation of actual combat interface test request methods get, post
- Esxi community network card driver
猜你喜欢

Wechat applet custom compilation mode

Use powercli to create a custom esxi ISO image

Installation and configuration of unit test framework jest with typescript

Method of designing test cases

MySQL主主

DNS forward resolution experiment

Network - transport layer (detailed version)

Applet custom components - data, methods, and properties

shell脚本——sort、uniq、tr、数组排序、cut、eval命令配置

DNS domain name resolution service
随机推荐
Cocos2d-x learning notes Tile Map tiledmap
MOOC翁恺C语言第五周:1.循环控制2.多重循环3.循环应用
Ubuntu18.04搭建redis集群【学习笔记】
MySQL常用命令
DNS domain name resolution service
Hdu-5805-nanoape loves sequence (thinking questions)
测试面试题集锦(五)| 自动化测试与性能测试篇(附答案)
[learning notes] drive
Installation and configuration of unit test framework jest with typescript
Firewall - iptables firewall (four tables and five links, firewall configuration method, detailed explanation of matching rules)
How to calculate the size of structure, segment and Consortium (common body)
Qgraphicsview promoted to qchartview
Gerapy use
Suger Bi create task
技术分享 | 实战详解接口测试请求方式Get、post
What is a linear table?
Repair the faulty sector
Use powercli to create a custom esxi ISO image
VSphere esxi 7.0 update 3 release notes
组管理和权限管理