#include<stdio.h> int main() { int i,s,k,x; scanf("%d",&s); while(s--) { scanf("%d",&k); for(i=k+1;i<=2*k;i++) { x=(k*i)/(i-k); if(k == i*x/(x+i)) printf("1/%d=1/%d+1/%d\n",k,x,i); } } return 0; }
时间: 2024-10-14 20:43:11
#include<stdio.h> int main() { int i,s,k,x; scanf("%d",&s); while(s--) { scanf("%d",&k); for(i=k+1;i<=2*k;i++) { x=(k*i)/(i-k); if(k == i*x/(x+i)) printf("1/%d=1/%d+1/%d\n",k,x,i); } } return 0; }