java实战编程小例子(一)
时间:2021-11-10 作者:匿名
你好世界,
public class HelloWorld { public static void main(String []args) { 域名tln("hello! world"); } }
三个数比大小,java初试
import 域名ner; public class Max { public static void main(String []args) { Scanner sc= new Scanner(域名); 域名tln("please input the first int num"); int num1=域名Int(); 域名tln("please input the second int num"); int num2=域名Int(); 域名tln("please input the three int num"); int num3=域名Int(); int max=num1; if(max<num2) { max=num2; } if(max<num3) { max=num3; } 域名tln("max("+num1+","+num2+","+num3+")"+"="+max);
9*9 乘法表 java乘法表
public class multtable { public static void main (String []args) { for(int i=1;i<=9;i++) { for(int j=1;j<=i;j++) { 域名t(j+"*"+i+"="+j*i+" "); } 域名tln(); } } }