求最大值max

来源:互联网 发布:google adb mac 编辑:程序博客网 时间:2024/06/05 02:25
import java.util.Scanner;class Max{ public static  void main(String[] args) {    int x,y,z;   int max;   Scanner sc=new Scanner(System.in);   x=sc.nextInt();   y=sc.nextInt();   z=sc.nextInt();  if(x>y){      if(x>z) max=x;      else   max=z;    }  else{      if(y>z)  max=y;      else   max=z;    } System.out.println("max="+max); }}

原创粉丝点击