You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
523 B

#include <bits/stdc++.h>
using namespace std;
int x, d = 0;
int main() {
double o;
cin >> x;
for (int i = 0; i <= 100; i++) {
for (int j = 0; j <= 100; j++) {
for (int k = 0; k <= 100; k++) {
o = x - i * i - j * j - k * k;
if (o >= 0) {
o = sqrt(o);
if (abs((o - int(o))) == 0) {
d++;
}
}
}
}
}
cout << d;
}