• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






许先

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 8 9 10 11 12

2016年5月27日

11.多重if
摘要: package cn.jbit.ifdemo; public class Compete { public static void main(String[] args) { int mingCi = 3; //名次 if (mingCi == 1) { System.out.println("参加麻省理工大学计算机学院... 阅读全文
posted @ 2016-05-27 22:23 许先 阅读(152) 评论(0) 推荐(0)
 
9.判断是否偶数
摘要: package test; import java.util.Scanner; public class NumJudge { /** * 判断一个数字是否为偶数 */ public static void main(String[] args) { Scanner input=new Scanner(System.in); ... 阅读全文
posted @ 2016-05-27 22:22 许先 阅读(258) 评论(0) 推荐(0)
 
8.会员卡号各位数字之和
摘要: package cn.bdqn; import java.util.Scanner; //导入Scanner类 public class PB_LuckyNumSum{ public static void main(String[] args){ int custNo; // 客户会员号 // 输... 阅读全文
posted @ 2016-05-27 22:21 许先 阅读(527) 评论(0) 推荐(0)
 
7.算术运算符的使用
摘要: package test; public class TestCalc { public static void main(String[] args) { System.out.println(6/4); System.out.println(6%4); int i=8; int j=i++ +2; in... 阅读全文
posted @ 2016-05-27 22:20 许先 阅读(142) 评论(0) 推荐(0)
 
6.两个数交换
摘要: package test; public class TestChange { public static void main(String[] args) { int num1=5; int num2=6; System.out.println("交换前:"); System.out.println("num1:"+nu... 阅读全文
posted @ 2016-05-27 22:19 许先 阅读(147) 评论(0) 推荐(0)
 
5.类型转换
摘要: public class TestConvert { public static void main(String[] args) { int num=9; double dnum=num; int inum=(int)dnum; double num1=9.8; int num2=(int... 阅读全文
posted @ 2016-05-27 22:18 许先 阅读(125) 评论(0) 推荐(0)
 
4.常量的使用
摘要: public class TestFinal { public static void main(String[] args) { //计算圆的面积 final double PI=3.14; int r=2; //PI=8; double area=PI*r*r; Sy... 阅读全文
posted @ 2016-05-27 22:17 许先 阅读(158) 评论(0) 推荐(0)
 
3.不同类型变量存取
摘要: public class TestType { public static void main(String[] args) { double score = 98.5; String name = "张三"; char sex = '男'; System.out.println("本次考试成绩最高 阅读全文
posted @ 2016-05-27 22:15 许先 阅读(237) 评论(0) 推荐(0)
 
2.Scanner的应用
摘要: import java.util.Scanner; public class TestScanner { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print(" 阅读全文
posted @ 2016-05-27 22:14 许先 阅读(182) 评论(0) 推荐(0)
 
helloworld
摘要: public class HelloWorld{ public static void main(String[] args){ //println()换行 print()不换行 System.out.println("Hello"); System.out.println("World!!!"); 阅读全文
posted @ 2016-05-27 22:11 许先 阅读(139) 评论(0) 推荐(0)
 
上一页 1 ··· 8 9 10 11 12