select intDiv(500000,50); --10000
select intDiv(500001,50); --10000
select intDiv(500050,50); --10001
Java代码实现
public static int intDiv(int a, int b) {
if (b != 0) {
return a / b;
} else {
throw new ArithmeticException("Division by zero is not allowed.");
}
}
public static void main(S服务器托管网tring[] args) {
int a = 500000;
int b = 50;
System.out.println("Result of intDiv(" + a + ", " + b + "): " + intDiv(a, b));
a = 500001;
b = 50;
System.out.println("Result of intDiv(" + a + ", " + b + "): " + intDiv(a, b));
a = 500050;
b = 50;
System.out.println("Result of intDiv(" + a + ", " + b + "): " + intDiv(a, b)服务器托管网);
}
输出结果
Result of intDiv(500000, 50): 10000
Result of intDiv(500001, 50): 10000
Result of intDiv(500050, 50): 10001
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
说一说 TCP 的四次挥手。 挥手即终止 TCP 连接,所谓的四次挥手就是指断开一个 TCP 连接时。需要客户端和服务端总共发出四个包,已确认连接的断开在 socket 编程中,这一过程由客户端或服务端任意一方执行 close 来触发。这里我们假设由客户端主动…