当前位置: 首页 > news >正文

个人网站建设作用跨专业的简历怎么制作

个人网站建设作用,跨专业的简历怎么制作,全运网站的建设,建立网站如何赚钱循环结构 文章目录 为什么要学习循环while循环dowhile循环偶数之和断点调试购物结算循环的选择类名和全类名摄氏华氏对照表for循环for执行次序五门功课成绩for的特殊写法break和continue录入客户信息_continue使代码优雅小数的比较不能用或! 为什么要学习循环 在编写代码时或! 为什么要学习循环 在编写代码时业务需求(项目要求)原地打转符合条件结束循环。 马拉松 (操场while循环 public class Demo01 {public static void main(String[] args) {/*while (条件) {循环的体内容;更新条件;}1 到 1005050*/int i 1, sum 0;while (i 100) {sum i;i;}System.out.println(和 sum);} } dowhile循环 public class Demo02 {public static void main(String[] args) {/*do {循环的体内容;更新条件;} while(条件);1 到 1005050*/int i 1, sum 0;do {sum i;i;} while (i 100);System.out.println(和 sum);} } 偶数之和 学员操作一计算100以内的偶数之和 训练要点 while循环结构 程序调试 需求说明 编程实现: 计算100以内 (包括100) 的偶数之和设置断点并调试程序观察每一次循环中变量值的变化public class Demo03 {public static void main(String[] args) {int n 1, sum 0;while (n 100) {if (n % 2 0) sum n;n;}System.out.println(sum: sum);} } 断点调试 购物结算 import java.util.Scanner;public class Demo04 {public static void main(String[] args) {Scanner scanner new Scanner(System.in);System.out.println(购物结算);System.out.println(请选择商品编号);System.out.println(1.T恤 2.网球鞋 3.网球拍);String jx y;while (jx.equals(y)) {System.out.print(请输入商品编号);int select scanner.nextInt();switch (select) {case 1:System.out.println(T恤 100元);break;case 2:System.out.println(网球鞋 200元);break;case 3:System.out.println(网球拍 300元);break;}System.out.print(是否继续y/n);jx scanner.next();}System.out.println(程序结束);} } 循环的选择 import java.util.Scanner;public class Demo05 {public static void main(String[] args) {Scanner scanner new Scanner(System.in);System.out.println(购物结算);System.out.println(请选择商品编号);System.out.println(1.T恤 2.网球鞋 3.网球拍);String jx;do {System.out.print(请输入商品编号);int select scanner.nextInt();switch (select) {case 1:System.out.println(T恤 100元);break;case 2:System.out.println(网球鞋 200元);break;case 3:System.out.println(网球拍 300元);break;}System.out.print(是否继续y/n);jx scanner.next();} while (jx.equals(y));System.out.println(程序结束);} } 类名和全类名 摄氏华氏对照表 public class Demo06 {public static void main(String[] args) {/*使用do-while实现输出 *摄氏温度 与 *华氏温度的对照表要求它从摄氏温度0度到250度每隔20度为一项对照表中的 *条目 不超过10条。转换关系华氏温度 摄氏温度 * 9 / 5.0 3*/double huashidu, sheshidu 0;int count 0;do {huashidu sheshidu * 9 / 5.0 32;System.out.println(sheshidu vs. huashidu);sheshidu 20;count;} while (sheshidu 250 count 10);} } for循环 public class Demo07 {public static void main(String[] args) {/*1 到 1005050特点循环次数固定下来的。建议使用for循环。for (声明初始化循环变量; 条件; 修改循环变量) {循环体;}*/int sum 0;for (int i0; i100; i) {sum i;}System.out.println(和 sum);} } for执行次序 五门功课成绩 import java.util.Scanner;public class Demo08 {public static void main(String[] args) {Scanner scanner new Scanner(System.in);System.out.print(请输入姓名);String name scanner.next(); // 记录姓名int sum 0; // 记录总成绩for (int i1; i5; i) {System.out.print(请输入5门功课的第 i 门的成绩);sum scanner.nextInt();}System.out.println(name 的平均分是 sum / 5.0);} } for的特殊写法 public class Demo09 {public static void main(String[] args) {for (int i0,j6; i6; i,j--) {System.out.println(i j 6);}} }break和continue import java.util.Scanner;public class Demo10 {public static void main(String[] args) {Scanner scanner new Scanner(System.in);int sum 0;for (int i1; i5; i) {System.out.print(成绩);int cj scanner.nextInt();if (cj 0) break; // 结束循环}System.out.println(最后);} } import java.util.Scanner;public class Demo11 {public static void main(String[] args) {Scanner scanner new Scanner(System.in);int sum 0;for (int i1; i5; i) {System.out.print(成绩);int cj scanner.nextInt();if (cj 0) continue; // 忽略当次sum cj;}System.out.println(和 sum);} } 录入客户信息_continue使代码优雅 import java.util.Scanner;public class Demo12 {public static void main(String[] args) {Scanner scanner new Scanner(System.in);System.out.println( 添加客户信息);for (int i1; i3; i) {System.out.print(会员号《4位》);int id scanner.nextInt();if (id 1000 id 9999) { // 满足条件1System.out.print(生日《mm/dd》);String birth scanner.next();if (birth.length() 5) { // 满足条件2System.out.print(积分);int jifeng scanner.nextInt();if (jifeng 0) { // 满足条件3System.out.println(会员信息是\n id \t birth \t jifeng);}}}}System.out.println(程序结束);} } 使用continue import java.util.Scanner;public class Demo13 {public static void main(String[] args) {Scanner scanner new Scanner(System.in);System.out.println( 添加客户信息);for (int i1; i3; i) {System.out.print(会员号《4位》);int id scanner.nextInt();if (id 1000 || id 9999) continue; // 过滤System.out.print(生日《mm/dd》);String birth scanner.next();if (birth.length() ! 5) continue; // 过滤System.out.print(积分);int jifeng scanner.nextInt();if (jifeng 0) continue; // 过滤System.out.println(会员信息是\n id \t birth \t jifeng);}System.out.println(程序结束);} } 小数的比较不能用或! import java.util.Scanner;public class Demo14 {public static void main(String[] args) {final double JINDU 0.00001;/*1. 录入一个小数1小数2小数3。判断小数1小数2是否等于小数3小数是模拟出来的数近似值。无法用 !进行比较的。*/Scanner scanner new Scanner(System.in);System.out.print(小数1);double d1 scanner.nextDouble();System.out.print(小数2);double d2 scanner.nextDouble();System.out.print(小数3);double d3 scanner.nextDouble();if (d1 d2 d3JINDU d1 d2 d3-JINDU) System.out.println(d1d2d3);else System.out.println(d1d2!d3);System.out.println(程序结束);} }
http://www.huolong8.cn/news/75782/

相关文章:

  • 专业网站的特点做网站有没有前途
  • 紫川网站建设最新国际新闻大事件
  • 有没有做婚车的网站项目定制开发网站
  • 浙江温州城乡建设网站福清哪有做网站的地方
  • 可以做哪些有趣的网站注册公司注册资金多少为好
  • 自己网站上放个域名查询建站工具评测 discuz
  • 对网站建设 意见和建议泰国浪琴手表网站
  • 国外做的比较好的购物网站百度营销中心
  • 做魔杖网站wordpress 未能连接到ftp服务器
  • 网站开发 ppt怎么自己做一个网页
  • 腾讯云网站备案吗免费设计签名软件
  • 搭建淘宝客网站源码网站前台怎么套用织梦后台
  • 企业手机网站建设咨询微能力者恶魔网站谁做的
  • 可以做雷达图的网站引擎搜索
  • 文山州建设局信息网站网站百度推广怎么做的
  • 照片管理网站模板公司商业网站怎么做
  • 深圳专业做网站设计做网站还能赚钱
  • 幸运28网站代理怎么做长春网站推广优化公司
  • 高密住房和城乡建设厅网站ui网站设计模板
  • 微信淘宝购物券网站是怎么做的2023网页设计十大品牌
  • wordpress主题知乎徐州关键词排名优化
  • 甘肃省建设厅执业资格注册网站公司企业注册信息查询
  • 有什么做设计的兼职网站建筑工程网站建站方案
  • 山东企业网站建设公司合肥网络公司排行榜
  • 青浦做网站公司手机网站代码下载
  • 母婴用品购物网站制作长清网站建设费用
  • 可以用来做视频网站的视频外链吗活动网站
  • 在线一键扒站源码php做淘宝客网站需要什么资质
  • 重庆网站建设的价格关于茶文化网站建设的背景
  • 创建网站好的平台什么网站收录快