Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6989 | 邓小龙 | 拆分分数 | C++ | Accepted | 1 MS | 268 KB | 500 | 2025-03-29 15:10:47 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int k,x,y; cin>>k; for(x=k+1;x<=2*k;x++){ int b=x-k,a=x*k;//y=(x-k)/(x*k)=a/b; if(a%b==0){ y=a/b; cout<<"1/"<<k<<" = "<<"1/"<<x<<" + 1/"<<y<<endl; } } return 0; }