import java.util.Scanner;
import java.lang.Math;
public class Main {
public static void main (String [] args) {
Scanner sc = new Scanner(System.in);
String [] input = sc.nextLine().split("/");
int a = Integer.parseInt(input[0]);
int b = Integer.parseInt(input[1]);
for (int i = Math.min(a, b); i > 1; i--) {
if (a % i == 0 && b % i == 0) {
a /= i;
b /= i;
}
}
System.out.print(a + "/" + b);
}
}
7-24 约分最简分式 (15 分)
最新推荐文章于 2024-08-14 15:16:03 发布