#include<stdio.h>
int gys(int a, int b);
int main()
{
int a, b, q;
scanf("%d,%d", &a,&b);/* 输入格式“ 数字,数字 例如:2,10 */
q = gys(a, b);
a = a / q;
b = b / q;
printf("%d/%d\n", a, b);
return 0;
}
int gys(int a, int b)
{
int x, y, c;
x = a, y = b;
while (y != 0)
{
c = x%y;
x = y;
y = c;
}
return x;
}
奕吉啊
奕吉啊
浮木3861767
相关分类