fix obvious error
This commit is contained in:
parent
2af0e53a15
commit
a46eae69fc
|
@ -8,12 +8,12 @@ int main(void) {
|
||||||
|
|
||||||
// if n is smaller than 3
|
// if n is smaller than 3
|
||||||
if (n < 3) {
|
if (n < 3) {
|
||||||
printf("0");
|
printf("0\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate through all
|
// Iterate through all
|
||||||
for (long long i = 3; i < n; i++) {
|
for (long long i = 3; i <= n; i++) {
|
||||||
sum += i * (i - 1) * (i - 2);
|
sum += i * (i - 1) * (i - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue