当前位置:网站首页>Blue Bridge Cup -- guess age
Blue Bridge Cup -- guess age
2022-07-03 22:25:00 【Deduce life】
1. subject
2. Ideas The stupid way I used Find out what matches Then see if 0 To 9 Once
3. Code
public class J85 {
public static void main(String[] args) {
for(int i=11;i<100;i++) {
int a=i*i*i;
int b=i*i*i*i;
int c=a/10000;// Yes a Value decomposition of
int d=a/1000%10;
int e=a/100%10;
int f=a/10%10;
int g=a%10;
int h=b/100000;// Yes b Value decomposition of
int q=b/10000%10;
int p=b/1000%10;
int o=b/100%10;
int l=b/10%10;
int k=b%10;
if(c+d+e+f+g+h+q+p+o+l+k==45) {//0 To 9 Once And for 45( Don't rule out accidental situations , We are just looking for the right value )
System.out.println(i+" "+a+" "+b);
}
}
}
}
Be careful : According to the output value Find out Instead of finding it all at once In short, my program is not standard But you can also find the answer
4. summary Brush problem
边栏推荐
- Classification and extension of OC
- Morning flowers and evening flowers
- Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?
- 2022 safety officer-b certificate examination summary and safety officer-b certificate simulation test questions
- Supply and demand situation and market scale calculation report of China's portable energy storage power PES industry Ⓛ 2022 ~ 2028
- Analysis report on the development trend and Prospect of global and Chinese supercontinuum laser source industry Ⓚ 2022 ~ 2027
- Harbor integrated LDAP authentication
- Redis single thread and multi thread
- Leetcode problem solving - 235 Nearest common ancestor of binary search tree
- [secretly kill little partner pytorch20 days] - [day3] - [example of text data modeling process]
猜你喜欢
Buuctf, misc: sniffed traffic
[Android reverse] use DB browser to view and modify SQLite database (download DB browser installation package | install DB browser tool)
1068. Consolidation of ring stones (ring, interval DP)
[dynamic programming] Ji Suan Ke: Suan tou Jun breaks through the barrier (variant of the longest increasing subsequence)
How to solve the problem of computer networking but showing no Internet connection
[automation operation and maintenance novice village] flask-2 certification
Control loop of program (while loop)
How to solve win10 black screen with only mouse arrow
[SRS] build a specified version of SRS
540. Single element in ordered array
随机推荐
6.0 kernel driver character driver
Leetcode: a single element in an ordered array
Yyds dry goods inventory hands-on teach you to create a jigsaw puzzle using the canvasapi
JS closure knowledge points essence
Oil monkey plug-in
Can you draw with turtle?
LeetCode 540. A single element in an ordered array
Common problems in multi-threaded learning (I) ArrayList under high concurrency and weird hasmap under concurrency
How about agricultural futures?
Asynchronous artifact: implementation principle and usage scenario of completable future
Awk getting started to proficient series - awk quick start
[template summary] - binary search tree BST - Basics
油猴插件
The difference between SRAM and DRAM
webAssembly
js demo 計算本年度還剩下多少天
Market layout planning and latest dynamic analysis report of China's smart public security industry Ⓕ 2022 ~ 2028
Data consistency between redis and database
[dynamic programming] Ji Suan Ke: Suan tou Jun breaks through the barrier (variant of the longest increasing subsequence)
BUUCTF,Misc:LSB