This commit is contained in:
2025-09-15 21:12:04 +08:00
commit 3f58f483ff
144 changed files with 5298 additions and 0 deletions

19
23/10/Q2652.h Normal file
View File

@@ -0,0 +1,19 @@
//
// Created by 李洋 on 2023/10/17.
//
#ifndef LEECODE_C_Q2652_H
#define LEECODE_C_Q2652_H
class Q2652 {
public:
int f(int n, int m) {
return (m + n / m * m) * (n / m) / 2;
}
int sumOfMultiples(int n) {
return f(n, 3) + f(n, 5) + f(n, 7) - f(n, 3 * 5) - f(n, 3 * 7) - f(n, 5 * 7) + f(n, 3 * 5 * 7);
}
};
#endif //LEECODE_C_Q2652_H