fix obvious error

This commit is contained in:
juan 2021-10-12 17:04:08 +08:00
parent 2af0e53a15
commit a46eae69fc
No known key found for this signature in database
GPG key ID: 5C1E5093C74F1DC7

View file

@ -8,12 +8,12 @@ int main(void) {
// if n is smaller than 3
if (n < 3) {
printf("0");
printf("0\n");
return 0;
}
// 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);
}