那位赐教
比较两个分数的大小,要求程序要把分数通分后的方法比较
#include<stdio.h>
void main()
{int m,n,molecule1,molecule2,denominator1,denominator2;
printf("please the two fractions :\n");
scanf("%d/%d,%d/%d",&molecule1,&denominator1,&molecule2,&denominator2);
printf("\n");
m=molecule1*denominator2;
n=molecule2*denominator1;
if(m>n)
printf("fraction1>fraction2");
else if(m==n)
printf("fraction1=fraction2");
else
printf("fraction1<fraction2");
}