import java.util.Scanner; publicclass Demo01 { publicstaticvoid main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入第一个数据"); int x = sc.nextInt();
System.out.println("请输入第二个数据"); int y = sc.nextInt(); int a = sum(x,y);
System.out.println(a);
} publicstaticint sum(int a,int b){ int max; if(a > b){
max = a;
}else{
max =b;
} return max;
}
}