#include <stdio.h>
int mod
(int a
, int b
) {
int result
, x
, y
;
result
= 1;
while (0 != a
%b
) {
x
= a
%b
;
y
= a
/b
;
a
= b
;
b
= x
;
result
= b
;
}
return result
;
}
int main(int argc
, char *argv
[]) {
int a
, b
;
int result
;
scanf("%d/%d", &a
, &b
);
result
= mod(a
, b
);
if (a
==b
) {
printf("1/1");
} else {
printf("%d/%d", a
/result
, b
/result
);
}
return 0;
}
转载请注明原文地址: https://lol.8miu.com/read-12272.html