飙血推荐
  • HTML教程
  • MySQL教程
  • JavaScript基础教程
  • php入门教程
  • JavaScript正则表达式运用
  • Excel函数教程
  • UEditor使用文档
  • AngularJS教程
  • ThinkPHP5.0教程

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();
}
}
}
标签:实战例子
湘ICP备14001474号-3  投诉建议:234161800@qq.com   部分内容来源于网络,如有侵权,请联系删除。