当前位置:网站首页>Those years can not do math problems, using pyhon only takes 1 minute?
Those years can not do math problems, using pyhon only takes 1 minute?
2022-04-23 02:37:00 【Experimental building V】
Click on the above “ The blue words ” Pay attention to our
During the Qingming holiday , My nephew in primary school threw his math homework to me . I look at the title :what?! This is the topic of primary school ?
The title is like this :
There is one less than 500 Three digits of abc, For this three digit number , A, B, C and d have the following words :
nail : This three digit number can be 2 to be divisible by 3 Time
B : This three digit number can be 3 to be divisible by 2 Time
C : This three digit number can be 7 to be divisible by
Ding : The sum of the three digit numbers is 15
It is known that : One of them lied , Excuse me, 2a+b+c=?
This question is not to use Python Is it solved ?
for a in range(1, 5):
for b in range(0, 9):
for c in range(0, 9):
abc = a * 100 + b * 10 + c
T1 = abc % 8 == 0 # nail :abc Can be 2 to be divisible by 3 Time
T2 = abc % 9 == 0 # B :abc Can be 3 to be divisible by 2 Time
T3 = abc % 7 == 0 # C :abc Can be 7 to be divisible by
T4 = a + b + c == 15 # Ding :abc The sum of all the numbers in is 15
if T1 is True and T2 is True and T3 is True: # Suppose Ding lied , The conditions for a, B and C are established
print(' Ding lied ,abc=%s' % abc)
elif T1 is True and T2 is True and T4 is True: # Suppose C lies , The conditions of Party A, Party B and Party D are established
print(' C lying ,abc=%s' % abc)
elif T1 is True and T3 is True and T4 is True: # Suppose b lies , The conditions for meprodin are established
print(' B lying ,abc=%s' % abc)
elif T2 is True and T3 is True and T4 is True: # Suppose a lies , The conditions for EPD are established
print(' A lie ,abc=%s' % abc)
loop + Judge , The steady !
The final output answer is :
B lying ,abc=168
I have a long sigh of relief , Finally, I made a good job ! I almost thought I was “ also 㕛 A kind of ” It's going to overturn ! incorrect ! This is a math problem ?! I use Python Tell him the answer , How can you understand ?!
Don't worry , I don't want to pull my hair away , hit “ 800 pages ” draft ! Directly to the sister who is a math teacher , There is a specialty in this field ! Code farmers knock code to solve problems , b. !
The key! !2022 year 4 month 24 Japan , Blue bridge cloud class will be launched The first 33 Phase building competition ——Python application : Math problems that couldn't be solved in those years , Take you to unlock the darkness of childhood , Welcome to the challenge !
The first 33 Introduction to phase I building competition
floor " The theme
Math problems that couldn't be solved in those years , Last Python Here's your answer !
Time of the game
2022 year 4 month 24 Japan 15:00 - 2022 year 4 month 30 Japan 24:00
Title Opening Hours
2022 year 4 month 24 Japan - 4 month 28 Japan
everyday 15:00 to open up 2 topic
The first 33 Building competition awards
The first 1-3 name
Enter key ×1
The first 4-20 name
7 Day standard member ×1
Challenge Award
complete 10 questions , Will receive value 199 yuan 《Python One hundred questions for customs clearance 》 Training camp courses
Participation Award
Take part in the answer to get 20 Yuan training camp coupon
▼ Scan the code to participate in the challenge ▼
▲ Meet a better self ▲
版权声明
本文为[Experimental building V]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220815083638.html
边栏推荐
- Synchronized锁及其膨胀
- The 16th day of sprint to the big factory, noip popularization Group Three Kingdoms game
- 智能辅助功能丰富,思皓X6安全配置曝光:将于4月23日预售
- Wechat public platform test number application, authorized login function and single sign on using hbuilder X and wechat developer tools
- 双亲委派模型【理解】
- leetcode 烹飪料理
- Niuke hand speed monthly race 48 C (I can't understand the difference. It belongs to yes)
- Data warehouse construction table 111111
- Develop a chrome plug-in from 0 (2)
- 都是做全屋智能的,Aqara和HomeKit到底有什么不同?
猜你喜欢
每日一题(2022-04-21)——山羊拉丁文
Day18 -- stack queue
PTA: 点赞狂魔
Talk about biology live broadcast: Dr. Wang Ziyuan, a lake view biology, exploring hepatitis B with gene therapy
VMware virtual machine installation openwrt as side route single arm route img image to vmdk
Fast and robust multi person 3D pose estimation from multiple views
JVM class loader
The importance of ERP integration to the improvement of the company's system
Applet canvas canvas half ring
002_ Redis_ Common operation commands of string type
随机推荐
16、 Anomaly detection
wordpress 调用指定页面内容详解2 get_children()
First day of rhcsa
Class initialization and instance initialization interview questions
定了,今日起,本号粉丝可免费参与网易数据分析培训营!
VMware virtual machine installation openwrt as side route single arm route img image to vmdk
每日一题(2022-04-21)——山羊拉丁文
A domestic image segmentation project is heavy and open source!
程序设计天梯赛 L1-49 天梯赛分配座位(模拟),布响丸辣
Halo open source project learning (I): project launch
[XJTU计算机网络安全与管理]第二讲 密码技术
JSP page nesting
Deploying sbert model based on torchserve < semantic similarity task >
The 16th day of sprint to the big factory, noip popularization Group Three Kingdoms game
使用Go语言构建Web服务器
Go language ⌈ mutex and state coordination ⌋
Suggestion: block reference sorting is in the order of keywords
tp6阿里云短信 window 报 cURL error 60: SSL certificate problem: unable to get local issuer certificate
Water diversion into chengluo Valley p1514
Flink stream processing engine system learning (III)