Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有三个变量 ab c。我想要一种方法(在java中)选择这些变量的最小值并将其加1而不使用数组对值进行排序。
有没有办法做到这一点 ?
在程序开始时,所有这些变量都将为零。
Math.min(Math.min(a,b), c) + 1
int a = 1; int b = 2; int c = 3; int min = Math.min(a, Math.min(b, c)) + 1;