Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int num;
- cin >> num;
- int counter = 0;
- for (int a = 0; a <= num; a++) {
- for (int b = 0; b <= num; b++) {
- for (int c = 0; c <= num; c++) {
- if (a + b + c == num) {
- counter++;
- }
- }
- }
- }
- cout << counter<< endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement