火柴棒等式
来源:互联网 发布:word画流程图软件 编辑:程序博客网 时间:2024/06/02 18:50
#include <iostream>#include <cstdio>using namespace std;int a[10]={6,2,5,5,4,5,6,3,7,6};int count;int main(){ int n; cin>>n; n-=4; int summ,t; for(int i=0;i<=2000;++i){ for(int j=0;j<=2000;++j){ if(i>=10){ summ=0; t=i; while(t>0){ summ+=a[t%10]; t/=10; } } else{ summ=a[i]; } if(j>=10){ t=j; while(t>0){ summ+=a[t%10]; t/=10; } } else{ summ+=a[j]; } t=i+j; if(t>=10){ while(t>0){ summ+=a[t%10]; t/=10; } } else{ summ+=a[t]; } //cout<<i<<" "<<j<<" "<<summ; if(summ==n)count++; //cout<<" "<<count<<" "<<n<<'\n'; //if(count==7)getchar(); //getchar(); } } cout<<count; return 0;}
阅读全文
0 0
- [NOIP2008]火柴棒等式
- 1766. 火柴棒等式
- [NOIP2008] 火柴棒等式
- 火柴棒等式
- 1106: 火柴棒等式
- noip 火柴棒等式
- P1012火柴棒等式
- NOIP2008 火柴棒等式
- noip2008火柴棒等式
- 火柴棒等式
- NOIP2008 火柴棒等式
- openjudge 火柴棒等式
- 火柴棒等式
- [NOIP2008] 火柴棒等式
- NOIP2008 火柴棒等式
- POJ8466火柴棒等式
- 火柴棒等式
- NOIp2008 火柴棒等式
- Centos7搭建wordpress
- javascript 敏感词过滤题 Cross the greatwall,We can reach every corner of the world.
- ORALCE官网下载JDK历史版本
- PAT-A-1050. 螺旋矩阵(25)
- SpringMVC工作总结001_SpringMVC拦截器(资源和权限管理)
- 火柴棒等式
- 巩固一下:SpringMVC详细示例实战教程
- 巩固一下:SpringMVC详细示例实战教程
- 数据库的基本操作
- 1001. 害死人不偿命的(3n+1)猜想
- linux基础入门之usermod命令
- ms14_064漏洞别IE打开链接执行远控木马
- qduoj CillyB盖房子(二分)
- HDU5247(技巧暴力)