#include<cstdio>
#include<iostream>
typedef struct{int x,y;}point;
point ans[10000];
int top,n;
void output()
{
printf("%d\n",top);
for(int i=1;i<=top;i++)
printf("1/%d = 1/%d + 1/%d\n",n,ans[i].x,ans[i].y);
}
int main()
{
//freopen("out.out","w",stdout);
while(scanf("%d",&n)==1&&n)
{
top=0;
for(int i=n+1;i<=2*n;i++)
if(i!=n)
{
int x=(n*i)/(i-n);
if((double)(x*(i-n)==(i*n)))
{
top++;
ans[top].x=x;
ans[top].y=i;
}
}
output();
}
return 0;
}UVA 10976(p183)----Fractions Again?!
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印


被折叠的 条评论
为什么被折叠?



