当前位置:网站首页>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();
}
}
}
}
}
边栏推荐
- spark:获取日志中每个时间段的访问量(入门级-简单实现)
- Usage differences of drop, truncate and delete
- Research Summary / programming FAQs
- Kali concise language transformation method (illustration)
- Extjs4 instance address and Chinese document address
- Problem handling of repeated restart during Siemens botu installation
- Tiger mouth waterfall: Tongliang version of xiaohukou waterfall
- CSDN垃圾的没有底线!
- Learning rate adjustment strategy in deep learning (1)
- Atcoder beginer contest 261 f / / tree array
猜你喜欢

LeetCode·每日一题·1184.公交站间的距离·模拟

Learning rate adjustment strategy in deep learning (1)

【MATLAB】MATLAB画图系列二 1.元胞与数组转化 2.属性元胞 3.删除nan值 4.合并多fig为同一fig 5.合并多fig至同一axes

Video game design report template and resources over the years

Overview of dobesie wavelet (DB wavelet function) in wavelet transform
![[NLP] next stop, embossed AI](/img/fc/4997309d0d53c5b6eb441ac39e6929.jpg)
[NLP] next stop, embossed AI

Conflict resolution of onblur and onchange

Under multi data source configuration, solve org.apache.ibatis.binding Bindingexception: invalid bound statement (not found) problem

Simple understanding and implementation of unity delegate

ISPRS2018/云检测:Cloud/shadow detection based on spectral indices for multi/hyp基于光谱指数的多/高光谱光学遥感成像仪云/影检测
随机推荐
循环结构practice
Detailed explanation of document operation
Typo in static class property declarationeslint
JS judge whether the data is empty
Detailed explanation of address bus, data bus and control bus
String application - calculate the longest true prefix of a string
Class loading mechanism and parental delegation mechanism
DS binary tree - maximum distance of binary tree nodes
Error when using Fiddler hook: 502 Fiddler - connection failed
《Route planning method for UAV in unknown environment based on improved SAS algorithm》翻译
老虎口瀑布:铜梁版小壶口瀑布
Number of bytes occupied by variables of type char short int in memory
“00后”来了!数睿数据迎来新生代「无代码」生力军
Beijing all in one card listed and sold 68.45% of its equity at 352.888529 million yuan, with a premium rate of 84%
The first n rows sorted after dataframe grouping nlargest argmax idmax tail!!!!
Various searches (⊙▽⊙) consolidate the chapter of promotion
Conversion of timestamp and time in Excel
How to set packet capturing mobile terminal
Data analysis and mining 1
Overall testing framework for performance testing