#include<stdio.h> int acc(int a,int b) { int temp; while(b!=0) { temp=a%b; a=b; b=temp; } return a; } int main() { int n,m,c; scanf("%d/%d",&n,&m); c=acc(n,m); n=n/c; m=m/c; printf("%d/%d",n,m); }
转载请标明出处:程序设计入门――C语言 翁恺 期末考试编程题
文章来源: 程序设计入门――C语言 翁恺 期末考试编程题