[Java/Python]输出两数中的最小数 one-liner
2021-01-04 05:30
标签:string import lin lse else tin NPU oid nbsp Java 输出的结果可以是: Python: [Java/Python]输出两数中的最小数 one-liner 标签:string import lin lse else tin NPU oid nbsp 原文地址:https://www.cnblogs.com/profesor/p/12985429.htmlimport java.util.Scanner;
public class compare
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.println("input your first number: ");
int a = scan.nextInt();
System.out.println("input your second number: ");
int b = scan.nextInt();
System.out.printf("the smaller number is %d.%n", a a : b);
}
}
input your first number:
56
input your second number:
-9
the smaller number is -9.
a = int(input("input your first number: \n"))
b = int(input("input your second number: \n"))
print(f"the smaller number is {a if a ")
#或者:
# print(f"the smaller number is {min(a, b)}")
文章标题:[Java/Python]输出两数中的最小数 one-liner
文章链接:http://soscw.com/index.php/essay/39978.html