当前位置:网站首页>Circular structure practice
Circular structure practice
2022-07-24 14:55:00 【Mo Nian】
public class Practice25 {
public static void main(String[] args) {
/*
* Li Bai walks on the street with nothing to do , Pick up the kettle and buy some wine . Double the store , See the flowers and have a drink , Wuyuhuahe store , Drink up the wine in the pot , How many buckets of wine are there in Li Bai's pot ?( Use for Loop structure programming )
* Tips : Use reverse thinking to analyze problems
*/
double sum = 0;
for (int i = 1; i <= 5; i++) {
sum = (sum+1)/2;
}
System.out.println(sum);
}
}
public class Practice29 {
public static void main(String[] args) {
// take 100 RMB converted into 1 element 、5 element 、10 Yuan change , How many exchange methods are there ?
int count = 0;
for (int i = 0; i <= 100; i++) {
for (int j = 0; j <= 20; j++) {
for (int m = 0; m <= 10; m++) {
if (i * 1 + j * 5 + m * 10 == 100) {
count++;
System.out.println(i + " " + j + " " + m);
}
}
}
}
System.out.println(count);
}
}
public static void main(String[] args) {
// seek 100 To 1000 All between can be 5 and 6 Integers divided by integers , Each line shows 5 individual
// Number of output numbers
int count = 0;
for(int i = 100;i<=1000;i++){
if(i%5==0||i%6==0){
System.out.print(i+" ");
// Write down the number of output numbers
count++;
if(count%5==0){
System.out.println();
}
}
}
}
}
边栏推荐
- 新手第一次怎么买股票 哪家证券公司开户最好最安全
- Caffe framework and production data source for deep learning
- Performance test - analyze requirements
- Learning and thinking about the relevant knowledge in the direction of building network security knowledge base
- Decrypt "sea Lotus" organization (domain control detection and defense)
- Calculate the M-day moving average price of two stocks
- Conflict resolution of onblur and onchange
- spark学习笔记(三)——sparkcore基础知识
- Strongly connected component
- 记不住正则表达式?这里我整理了99个常用正则
猜你喜欢

Must use destructuring props assignmenteslint

Number of bytes occupied by variables of type char short int in memory

Performance test - Test Execution

Various searches (⊙▽⊙) consolidate the chapter of promotion

Detailed explanation of address bus, data bus and control bus

Mysql库的操作

Overall testing framework for performance testing

Isprs2018/ cloud detection: cloud/shadow detection based on spectral indexes for multi/hyp multi / hyperspectral optical remote sensing imager cloud / shadow detection

Simple understanding and implementation of unity delegate

After reading this article, I found that my test cases were written in garbage
随机推荐
AG. DS binary tree -- hierarchical traversal
TS learning record (I) sudo forgets the password (oolong) try changing the 'lib' compiler option to include 'DOM'
Under multi data source configuration, solve org.apache.ibatis.binding Bindingexception: invalid bound statement (not found) problem
VSCode如何调试Nodejs
spark:获取日志中每个时间段的访问量(入门级-简单实现)
Error when using Fiddler hook: 502 Fiddler - connection failed
Usage differences of drop, truncate and delete
Kotlin类与继承
Extjs4 instance address and Chinese document address
pytorch with torch.no_grad
PrestoUserError: PrestoUserError(type=USER_ERROR, name=INVALID_FUNCTION_ARGUMENT, message=“Escape st
Video game design report template and
Regular expression and bypass cases
记不住正则表达式?这里我整理了99个常用正则
Operation of MySQL Library
Tiger mouth waterfall: Tongliang version of xiaohukou waterfall
The difference and relation among list, set and map
Class loading mechanism and parental delegation mechanism
The spiral matrix of the force buckle rotates together (you can understand it)
Atcoder beginer contest 261 f / / tree array