![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
四门编程基础对比
上天的猴
这个作者很懒,什么都没留下…
展开
-
switch case
public class Test { public static void main(String args[]){ char grade = ‘C’; switch(grade) { case 'A' : System.out.println("优秀"); break; case 'B' : case 'C' : System.out.println("良好"); break; case '原创 2020-05-22 23:38:59 · 167 阅读 · 0 评论 -
控制台输入
python: input() java: import java.util.Scanner; Scanner s1 = new Scanner(System.in); System.out.println("Please enter your year:\n"); int y = s1.nextInt(); System.out.println("Please enter your month:\n"); int m = s1.nextInt(); C: scanf() C+原创 2020-05-27 21:30:10 · 208 阅读 · 0 评论 -
java创建对象(与python,c++对比)
java: Puppy myPuppy = new Puppy(“kimmi”); python: puppy = Puppy(“kimmi”) C++:(定义了Student类) Studeng liLei;原创 2020-05-22 18:07:31 · 171 阅读 · 0 评论 -
开平方函数
java: Math.sqrt(); //不用导入 C: sqrt(); //不用导入 C++: sqrt(); //要导入 #include <math.h> python: i ** 0.5原创 2020-05-27 18:37:58 · 1024 阅读 · 0 评论