From 86e1cad16b8d245054cb8328005773e13c0414aa Mon Sep 17 00:00:00 2001 From: li-ziyuan1210 <1298453558@qq.com> Date: Thu, 17 Dec 2020 17:25:30 +0800 Subject: [PATCH] lesson02 --- .../\347\273\203\344\271\240.java" | 58 +++++++++++++++++++ .../\347\273\203\344\271\2402.java" | 35 +++++++++++ 2 files changed, 93 insertions(+) create mode 100644 "\346\235\216\345\255\220\346\272\220\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\347\273\203\344\271\240.java" create mode 100644 "\346\235\216\345\255\220\346\272\220\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\347\273\203\344\271\2402.java" diff --git "a/\346\235\216\345\255\220\346\272\220\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\347\273\203\344\271\240.java" "b/\346\235\216\345\255\220\346\272\220\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\347\273\203\344\271\240.java" new file mode 100644 index 0000000..f028712 --- /dev/null +++ "b/\346\235\216\345\255\220\346\272\220\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\347\273\203\344\271\240.java" @@ -0,0 +1,58 @@ +package lesson2; + +import java.util.Scanner; + +public class yx { + + public static void main(String[] args) { + /*编写程序,定义变量,分别存放游戏中某个英雄的属性信息, +包括:人物角色名(roleName)、生命值(health)、攻击力(damage)、防御力(defense)、武器加成(weaponScaling)、是否是热门英雄(isHot)。 +打印出来。 + +这些属性的信息由用户输入。 + + * + */ + // TODO Auto-generated method stub + Scanner scanner=new Scanner(System.in); + + System.out.println("请输入人物角色名"); + String roleName= scanner.next(); + + System.out.println("请输入生命值"); + long health= scanner.nextLong(); + + System.out.println("请输入攻击力"); + int damage = scanner.nextInt(); + + System.out.println("请输入防御力"); + int defense= scanner.nextInt(); + + System.out.println("请输入武器加成"); + float weaponScaling= scanner.nextFloat(); + + System.out.println("请输入是否是热门英雄"); + boolean isHot = scanner.nextBoolean(); + + System.out.println("英雄的信息如下:"); + + System.out.println("人物角色名"+roleName); + + System.out.println("生命值"+health); + + System.out.println("攻击力"+damage); + + System.out.println("防御力"+defense); + + System.out.println("武器加成"+weaponScaling); + + System.out.println("是否是热门英雄"+isHot); + + + + + + + } + +} diff --git "a/\346\235\216\345\255\220\346\272\220\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\347\273\203\344\271\2402.java" "b/\346\235\216\345\255\220\346\272\220\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\347\273\203\344\271\2402.java" new file mode 100644 index 0000000..fafd293 --- /dev/null +++ "b/\346\235\216\345\255\220\346\272\220\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\347\273\203\344\271\2402.java" @@ -0,0 +1,35 @@ +package lesson2; + +import java.util.Scanner; + +import javax.swing.text.html.CSS; + +public class xingminglianl { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Scanner scanner=new Scanner(System.in); + System.out.println("请输入你的姓名"); + String name =scanner.next(); + + System.out.println("请输入你的年龄"); + int age =scanner.nextInt(); + + System.out.println("请输入你的性别"); + String xingbie=scanner.next(); + + System.out.println("请输入你的学号"); + int xuehao =scanner.nextInt(); + + System.out.println("请输入你的HTML成绩"); + int chengji =scanner.nextInt(); + + System.out.println("信息如下"); + System.out.println("你的名字是;"+name); + System.out.println("你的年龄是;"+age); + System.out.println("你的性别是;"+xingbie); + System.out.println("你的学号是;"+xuehao); + System.out.println("你的HTML成绩是;"+chengji); + } + +} -- Gitee