![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
牛客-Java语法入门
文章平均质量分 54
CON_FREECSS
热爱世界热爱你
展开
-
java3-四舍五入
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double d= scanner.nextDouble(); //考察浮点数的性质+强制转换-变量 //write your code here...... int i=(int...原创 2022-03-30 21:39:04 · 574 阅读 · 0 评论 -
java2-简单运算
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); int b = scanner.nextInt(); scanner.close(); //Q:这里的Scanner是属于io...原创 2022-03-30 21:38:07 · 1132 阅读 · 0 评论 -
java1-类型转换
import java.util.Scanner; public class Main { public static void main(String[] args) { //法一:直接在main方法中进行强转 //算法:Scanner类对象,调用nextDouble方法,接收后台输入的double值-- //将值用 double d接收-- //将b强转成int,用a接收-- //输出打印a // Scann...原创 2022-03-30 21:29:23 · 680 阅读 · 0 评论