Skip to content

Instantly share code, notes, and snippets.

@hhc0null
Created March 24, 2012 13:15
Show Gist options
  • Save hhc0null/2182673 to your computer and use it in GitHub Desktop.
Save hhc0null/2182673 to your computer and use it in GitHub Desktop.
aoj-0008-Sum_of_4_Integers.cpp
// AOJ0008
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <stack>
int main() {
int i, j, k, l, n, cnt;
for(;scanf("%d", &n) == 1;) {
cnt = 0;
for(i = 0; i < 10; i++) {
for(j = 0; j < 10; j++) {
for(k = 0; k < 10; k++) {
for(l = 0; l < 10; l++) {
if(n == (i + j + k + l)) {
cnt++;
}
}
}
}
}
printf("%d\n", cnt);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment