Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
96716 | 王思颜 | 完美立方 | C++ | Wrong Answer | 1 MS | 268 KB | 403 | 2024-11-09 12:06:24 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; for (int a = 2;a <= n;a++){ for (int b = 2;b <= a;b++){ for (int c = 2;c <= a;c++){ for (int d = 2;d <= a;d++){ if (a * a * a == b * b * b + c * c *c + d * d * d && b <= c && c <= d){ cout<<"Cube = "<<a<<"Triple = "<<"("<<b<<","<<c<<","<<d<<")"; } } } } } return 0; }
------Input------
12
------Answer-----
Cube = 6, Triple = (3,4,5) Cube = 12, Triple = (6,8,10)
------Your output-----
Cube = 6Triple = (3,4,5)Cube = 12Triple = (6,8,10)