Using java to find the greatest common divisor and the least common multiple of two integers

Using java to find the greatest common divisor and the least common multiple of two integers


package com.fmzrt ; / * * find the greatest common divisor and the least common multiple of two numbers * @ author Kele * * / public class gongyuegongbeishu {/ * * find the greatest common divisor of two numbers * @ param m * @ param n * @ return * / public static int maxgys (int m, int n) {



Finding the least common multiple of two numbers with Java


public int gongbeishu(int x,int y){
for(int i = 0;i



(40 + 60) x = 1500 to solve the equation


(40+60)x=1500
100x=1500
x=15



Solution equation: X / 40 = x / 60 + 7
The slash in the middle is the fractional line


  x/40-x/60=7
  6x/240-4x/240=7
  2x/240=7
  x/120=7
  x=840



How to use the expression of electric power calculation


P=UI=I²R=U²/R=W/t
P is electrical power, u is voltage, I is current, R is resistance, W is electrical energy, t is time



The water level difference between the upstream and downstream of the Three Gorges Dam on the Yangtze River can reach up to 113m. The ship on the upstream has to pass through five lock chambers to gradually lower the ship's hull. The water level of each lock chamber changes more than 20 meters. Therefore, the Three Gorges ship lock's gate is very large. Each miter gate is 39.5m high and 20.2m wide. If the water level outside the gate is 30m high, the maximum pressure of the water on the gate is______ PA, given that the average pressure of water on the gate is half of the maximum pressure, then the pressure of water on the gate is______ N. (g = 10N / kg)


H = 30m, the maximum pressure of the gate: P = ρ GH = 1.0 × 103kg / m3 × 10N / kg × 30m = 3 × 105Pa; the average pressure of the gate: P = 12p = 12 × 3 × 105Pa = 1.5 × 105Pa; the stress area of the gate: S = 30m × 20.2m = 606m2, the pressure of the gate: F =. PS = 1.5 × 105Pa



When x0 = - 1, find the nth order Taylor formula of function f (x) = 1 / X
The answer is f (x) = 1 / x, the nth order Taylor formula is f (x) = - 1 - (x + 1) - (x + 1) ^ 2 - (x + 1) ^ n + RN (x). I want to ask why each term is not divided by factorial?


There is a higher derivative of F (x0) in every term of Taylor's formula. The coefficient of this derivative is about 1 with the following factorial, so the answer is not divided by the factorial



In a class, there are two more girls than three fifths of the class, and 22 boys. How many students are there in the class


There are X students in the class
Female: 3 / 5 * x + 2
Class size - Girls = boys
X - 3/5 * X +2 = 22
2/5 * X = 20
X = 50



How much is minus five times one


(-5)×(-1/5)=1



The limit of sequence [(- 1) ^ n + 1] [(n + 1) / N]
N = 2n and N = 2n + 1?


When n = 2n, [(- 1) ^ n + 1] [(n + 1) / N] = [(- 1) ^ (2n) + 1] / [(2n + 1) / (2n)] = (2n + 1) / N = 2 + 1 / N,
When n = 2n - > infinity, N - > infinity, [(- 1) ^ n + 1] [(n + 1) / N] = 2 + 1 / N → 2
When n = 2n + 1, [(- 1) ^ n + 1] [(n + 1) / N] = [(- 1) ^ (2n + 1) + 1] [(2n + 2) / (2n + 1)] = 0
When n = 2n + 1 - > infinity, [(- 1) ^ n + 1] [(n + 1) / N] - > 0 is not equal to 2
Therefore, when n - > infinity, the limit of [(- 1) ^ n + 1] [(n + 1) / N] does not exist