In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to use Java to achieve the effect of outputting age groups according to age values." Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "how to use Java to output age group effect according to age value"!
Title:
According to age, print out the current age of the person is juvenile (under 18), youth (19-28), middle age (29-55), old age (56 +)
Java code implementation
import java.util.Scanner;
public static void main0(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Please enter the age of this person: ");
int age = scan.nextInt();
if(age>=0 && age=19 && age=29 && age=56){
System.out.println("old");
}
}
We enter a numerical value, and the program prints out the age range.
Second, print 1-100 prime numbers
Title:
Prints prime numbers between 1 and 100
Java code implementation
public static void main(String[] args) {
int i=1;
int j=2;
int count=0;
for(i=1;i
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.