| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 137634 | 翁思宸 | 拆分分数 | C++ | Accepted | 5 MS | 272 KB | 1135 | 2025-11-21 19:04:19 |
/* //1488 方程求解 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int m=0,n=0,x=0,y=0,z=0; cin>>m>>n; for(int x=1;x<=m;x++){ y=m-x; if(x*y==n){ cout<<"Yes"; return 0; } } cout<<"No"; return 0; } //1489 水仙花数II #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int m=0,n=0,x=0,y=0,z=0,f=0; cin>>m>>n; for(int i=m;i<=n;i++){ x=i/100; y=i/10%10; z=i%10; if(x*x*x+y*y*y+z*z*z==i){ cout<<i<<" "; f=1; } } if(f==0){ cout<<"no"; } return 0; }*/ //1490 拆分分数 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int k=0,x=0,y=0,f=0; cin>>k; for(int i=k+1;i<=2*k;i++){ int a=i-k; int b=i*k; if(b%a==0){ cout<<"1/"<<k<<" = 1/"<<i<<" + 1/"<<b/a<<endl; } } return 0; }