| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 | 
|---|---|---|---|---|---|---|---|---|
| 135138 | 徐英杰 | 完美立方 | C++ | Wrong Answer | 5 MS | 280 KB | 611 | 2025-11-02 16:45:36 | 
#include <iostream> #include<cmath> using namespace std; void OJ1491(int n) { for (int a = 2;a <= n;a++) { for (int b = 2;b <= n;b++) { for (int c = 2;c <= n;c++) { for (int d = 2;d<= n;d++) { bool tiaojian=( pow(a,3) == pow(b,3) + pow(c,3) + pow(d,3) ) && (b <= c && c<=d); if (tiaojian) { cout<<"("<<a<<","<<b<<","<<c<<","<<d<<")"<<endl; } } } } } } int main() { int N; cin>>N; OJ1491(N); return 0; }
------Input------
12
------Answer-----
Cube = 6, Triple = (3,4,5) Cube = 12, Triple = (6,8,10)
------Your output-----
(6,3,4,5) (12,6,8,10)