Skip to content

Instantly share code, notes, and snippets.

@Chinaxiang
Created March 30, 2013 15:04
Show Gist options
  • Save Chinaxiang/5277020 to your computer and use it in GitHub Desktop.
Save Chinaxiang/5277020 to your computer and use it in GitHub Desktop.
比较两个数的大小!方法一
public class H10{
public static void main(String[] args){
java.util.Scanner input=new java.util.Scanner(System.in);
System.out.println("请输入两个数:");
int num1=input.nextInt();
int num2=input.nextInt();
if(num1>=num2){
System.out.println("这两个数中的较大者为:"+num1);
}
else{
System.out.println("这两个数中的较大者为:"+num2);
}
}
}
Copy link

ghost commented Mar 30, 2013

法克尤,坑!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment