void compFraction(int n, int d)
{
int quo, remainder;
quo = n/d;
remainder = n%d;
if (first)
{
first=0;
printf("%d;", quo);
}
else
printf("%d,", quo);
if (remainder!=1 && remainder!=0)
compFraction(d, remainder);
else
printf("%d]\n", d);
}
p834題目連結
回ACM題庫目錄
回首頁
沒有留言:
張貼留言