import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int[]match={6,2,5,5,4,5,6,3,7,6}; while(sc.hasNext()){ int n=sc.nextInt(); int count=0; for (int a = 0; a< 800; a++) { if(a>150&&!(a+"").contains("1")) continue; for (int b = a; b< 800; b++) {if(b>150&&!(b+"").contains("1")) continue; int c=a+b; int sum=0; String s=a+""; for (int i = 0; i < s.length(); i++) { sum+=match[s.charAt(i)-'0']; } if(sum>n-4) continue; s=b+""; for (int i = 0; i <s.length(); i++) { sum+=match[s.charAt(i)-'0']; } if(sum>n-4) continue; s=c+""; for (int i = 0; i < s.length(); i++) { sum+=match[s.charAt(i)-'0']; } if(sum==n-4){ if(a<b) count+=2; else if(a==b) count+=1; } } } System.out.println(count); } } }
0.0分
1 人评分
简单编码 (C++代码)(这里推荐用switch)浏览:999 |
数列 (C++代码)浏览:707 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:551 |
C语言训练-求素数问题 (C语言代码)浏览:1509 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:998 |
众数问题 (C语言代码)浏览:911 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:683 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:541 |
Cylinder (C语言描述+详细分析)浏览:3375 |
1113题解浏览:823 |