1.找出1~5000范围内分别满足如下条件的数: (1) 7或11或13的倍数 (2) 7、11,或7、13或11、13的倍数 (3) 7、11和13的倍数。

package chapter3;

public class demo1 {
public static void main(String[] args) {
for(int i=1;i<=5000;i++) {
if(i%7==0||i%11==0||i%13==0) {
System.out.print(i+" ");
if(i%100==0) {
System.out.println();
}
}
}
System.out.println();
System.out.println();
System.out.println();
for(int i=1;i<=5000;i++) {
if((i%7==0&&i%11==0)||(i%7==0&&i%13==0)||(i%11==0&&i%13==0)) {
System.out.print(i+" ");
}
}
System.out.println();
System.out.println();
System.out.println();
for(int i=1;i<=5000;i++) {
if(i%7==0&&i%11==0&&i%13==0) {
System.out.print(i+" ");
}
}
}
}

最新文章

  1. PL/SQL循环
  2. 第3月30天 UIImage imageWithContentsOfFile卡顿 Can&#39;t add self as subview MPMoviePlayerControlle rcrash
  3. ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn&#39;t supported yet
  4. Java关键字——static
  5. poj邮局1160
  6. spring 代码中获取ApplicationContext(@AutoWired,ApplicationListener)
  7. The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
  8. 使用cobbler工具实现centos 6,7系统的自动化安装
  9. 第八节 JS运动基础
  10. 利用dockerfile定制镜像
  11. Spring cloud info信息显示
  12. Java 中的 static 使用
  13. 8.3Solr API使用(StatsComponent聚合统计)
  14. 【面向对象】----【prototype&amp;&amp;__proto__&amp;&amp;实例化对象三者之间的关系】(四)-----【巷子】
  15. js执行环境的周边概念
  16. 【UVA10079 训练指南】收集者的难题【最大流】
  17. MATLAB入门学习(整合)
  18. MapReduce计算每年最大值
  19. Verilog 参数化设计
  20. XMU 1615 刘备闯三国之三顾茅庐(三) 【欧拉函数+快速幂+欧拉定理】

热门文章

  1. Coderforces 633D:Fibonacci-ish(map+暴力枚举)
  2. 1、Java简介
  3. wcf服务编程(一)
  4. git rebase VS git merge? 更优雅的 git 合并方式值得拥有
  5. python对Excel的读取
  6. TensorFlow高效读取数据的方法——TFRecord的学习
  7. 【Gym - 100923A】Por Costel and Azerah(思维水题)
  8. Visual Studio 2015 WinForm应用程序打包教程
  9. 我造了个好大的&quot;轮子&quot;,居然还不是&quot;圆&quot;的!
  10. 做dede网站知识点总结(捷斯网站)