Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109084 | 6张轶涵 | 拆分分数 | C++ | Wrong Answer | 1 MS | 272 KB | 297 | 2025-01-25 20:02:21 |
#include <bits/stdc++.h> using namespace std; bool f=false; int main() { int k; cin>>k; for(int i=1;i<=k;i++) { for(int j=1;j<=k;j++) { float a=1/k*1.0,b=1/i*1.0,c=1/j*1.0; if(a==b+c) { cout<<"1/"<<k<<" = 1/"<<i<<" + 1/"<<j<<endl; } } } return 0; }
------Input------
4
------Answer-----
1/4 = 1/5 + 1/20 1/4 = 1/6 + 1/12 1/4 = 1/8 + 1/8
------Your output-----
1/4 = 1/2 + 1/2 1/4 = 1/2 + 1/3 1/4 = 1/2 + 1/4 1/4 = 1/3 + 1/2 1/4 = 1/3 + 1/3 1/4 = 1/3 + 1/4 1/4 = 1/4 + 1/2 1/4 = 1/4 + 1/3 1/4 = 1/4 + 1/4