Get the App
SLTechnology News&Howtos  ›  Development  › 

How java outputs all the daffodils in the console

Shulou Source: shulou.com Published: 2022-06-01 02:56:42 10月02日 Update

This article mainly introduces java how to output all the daffodils in the console, the article is very detailed, has a certain reference value, interested friends must read it!

Daffodils

Topic: output all the daffodils in the console

What is the number of daffodils?

Daffodils are a triple digit.

The cube sum of the number of daffodils, ten digits and hundred digits is equal to the original.

Analysis:

Use a loop to iterate through all three digits (from 100 to 999)

Get the value on each bit in the three digits before calculation

Take out each value in the three digits, calculate the cube sum and compare it with the original value

Output the number of daffodils.

Practice:

The code is as follows (example):

Public class Demo1 {public static void main (String [] args) {/ / do not like ginger but do not be jealous / / use the loop to traverse all three digits (from 100th to 999th); for (int iTunes 100teri

Tags: Daffodils daffodils digits output values consoles controls bits content articles loops code values interests guys buddies numbers more ginger knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Tech Info Redmi Huawei NVidia