当前位置:网站首页>Blue Bridge Cup - Castle formula
Blue Bridge Cup - Castle formula
2022-07-06 03:37:00 【Deduce life】
1. subject
2. Ideas Violence starts with 10000 Find the matching number Do it for the first time Five unequal conditions mean wrong Then improved The code is quite long
3. Code
public class J84 {
public static void main(String[] args) {
for(int i=10000;i<100000;i++) {
int a=i/10000;// Ten thousand position
int b=i/1000%10;// Thousand bit
int c=i/100%10;// Hundred bit
int d=i/10%10;// ten
int e=i%10;// bits
int f=e*10000+d*1000+c*100+b*10+a;// Turn into EDCBA
for(int j=1;j<10;j++) {// The condition that five numbers are not equal to each other
if(a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=d&&b!=e&&c!=d&&c!=e&&d!=e) {
if(i*j==f) {
System.out.println(i);
}
}
}
}
}
}
边栏推荐
猜你喜欢
Force buckle 1189 Maximum number of "balloons"
Pointer written test questions ~ approaching Dachang
ESBuild & SWC浅谈: 新一代构建工具
Canvas cut blocks game code
给新人工程师组员的建议
IPv6 comprehensive experiment
Exness foreign exchange: the governor of the Bank of Canada said that the interest rate hike would be more moderate, and the United States and Canada fell slightly to maintain range volatility
C language circular statement
施努卡:3d视觉检测应用行业 机器视觉3d检测
2.2 STM32 GPIO操作
随机推荐
2.1 rtthread pin device details
Computer graduation project asp Net fitness management system VS development SQLSERVER database web structure c programming computer web page source code project
Teach you to build your own simple BP neural network with pytoch (take iris data set as an example)
A brief introduction to symbols and link libraries in C language
2.2 fonctionnement stm32 GPIO
Brush questions in summer -day3
Force buckle 1189 Maximum number of "balloons"
How to choose PLC and MCU?
2.2 STM32 GPIO operation
mysqldump数据备份
Microkernel structure understanding
Research on cooperative control of industrial robots
Recommended papers on remote sensing image super-resolution
Deno介绍
Schnuka: what is visual positioning system and how to position it
Advanced learning of MySQL -- Fundamentals -- isolation level of transactions
Edcircles: a real time circle detector with a false detection control translation
施努卡:什么是视觉定位系统 视觉系统如何定位
数据分析——seaborn可视化(笔记自用)
The next industry outlet: NFT digital collection, is it an opportunity or a foam?