Skip to content

Instantly share code, notes, and snippets.

@mojaie
Created December 3, 2011 13:55
Show Gist options
  • Save mojaie/1427181 to your computer and use it in GitHub Desktop.
Save mojaie/1427181 to your computer and use it in GitHub Desktop.
AOJ:0008
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
while(scn.hasNext()) {
int cnt = 0;
int n = scn.nextInt();
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
for (int k = 0; k < 10; k++) {
for (int l = 0; l < 10; l++) {
if (i + j + k + l == n) {
cnt++;
}
}
}
}
}
System.out.println(cnt);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment