Created
March 30, 2013 15:04
-
-
Save Chinaxiang/5277020 to your computer and use it in GitHub Desktop.
比较两个数的大小!方法一
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
法克尤,坑!!!