


Write a small program to solve an interesting perverted Mathematical Olympiad problem.
The question is like this:
There are 6 people who were all born on April 11, and they are all Ox. The product of their ages in a certain year is 17597125. What is the sum of their ages in this year? ?
If you are a math whiz and have figured out a mathematical solution. Please leave your method in the comments below.
If you are a programming expert and come up with a better algorithm than the one below, please leave your method.
If you think about it, but still can’t figure it out. Then take a look at the program below.
class Gusse { public static void main(String[] args){ int sut1=1,sut2=1,sut3=1,sut4=1,sut5=1,sut6=1; long mul=0,sum=0; for(sut1=1;sut1<=15;sut1++){ for(int n2=0;n2<=10;n2++){ sut2=sut1+n2*12; for(int n3=0;n3<=10;n3++){ sut3=sut1+n3*12; for(int n4=0;n4<=10;n4++){ sut4=sut1+n4*12; for(int n5=0;n5<=10;n5++){ sut5=sut1+n5*12; for(int n6=0;n6<=10;n6++){ sut6=sut1+n6*12; if((mul=sut1*sut2*sut3*sut4*sut5*sut6)==17597125){ System.out.println("sut1="+sut1); System.out.println("n2="+n2); System.out.println("n3="+n3); System.out.println("n4="+n4); System.out.println("n5="+n5); System.out.println("n6="+n6); System.out.println("sum="+(sum=sut1+sut2+sut3+sut4+sut5+sut6)); break; } } } } } } } } }
Copy the program intact into Notepad, and then run it with java to get the result.
The above is the detailed content of Write a small program to solve an interesting perverted Mathematical Olympiad problem.. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!