【C++心路历程11】火柴棒等式1182,打表!
2017-07-14 20:11
295 查看
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> using namespace std; int a[25]={0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,8,9,6,9,29,39,38,65,88,128}; int main() { int n; scanf("%d",&n); cout<<a ; return 0; } /*#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> using namespace std; int a[10]={6,2,5,5,4,5,6,3,7,6}; char b[10]; int gun(int x) { int c[10]; int ans=0,k=0; if(x==0) return 6; while(x>0) { c[k]=x%10; x=x/10; k++; } for(int i=0;i<k;i++) { ans+=a[c[i]]; } memset(c,0,sizeof(c)); k=0; return ans; } int main() { freopen("out.txt","w",stdout); int cnt=0,n; for(int i=1;i<=24;i++) { for(int A=0;A<=1112;A++) for(int B=0;B<=1112;B++) { int C=A+B; if(gun(A)+gun(B)+gun(C)+4==i) cnt++; } printf("%d,",cnt); cnt=0; } return 0; } */
相关文章推荐
- 【C++心路历程11】1182火柴棒等式,打表!
- 1106: 火柴棒等式
- <NOIP> 24 . P1149 火柴棒等式
- noip2008 火柴棒等式
- HDU 4002 Find the maximum(C++大整数实现+打表)
- [noip模拟]四道题 noip2008 笨小猴 noip2008 火柴棒等式 noip2008 双栈排序 noip2008 传纸条
- NOIP2008 火柴棒等式
- 火柴棒等式
- 2008NOIP 火柴棒等式淫荡结题报告
- luogu1149 火柴棒等式(NOIP2008提高组第2题)
- 火柴棒等式
- 【C++心路历程15】【USACO1.5.2】回文质数 打表在前 方法在其后
- F: 火柴棒等式
- NOIP2008 笨小猴 火柴棒等式 传纸条 双栈排序
- luogu P1149 火柴棒等式
- 请发挥你的思维,只移动一根火柴将以下算式(1-701=2)摆成等式!
- 火柴棒等式
- codevs火柴棒等式 枚举
- NOIP2008解题报告(C/C++)(笨小猴)(火柴棒等式)(传纸条)(双栈排序)
- [NOIP2008]笨小猴,火柴棒等式,传纸条,双栈排序