#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;}
- 3 回答
- 0 关注
- 1427 浏览
添加回答
举报
0/150
提交
取消