@[fzj2007](/space/show?uid=172370) 布吉岛QAQ
~~还有为什么不这样做呢qaq~~
```
#include <bits/stdc++.h>
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;
cin>>n;
cout<<a[n]<<endl;
return 0;
}
```
by wpy233 @ 2019-10-05 09:13:18
。。。
by fzj2007 @ 2019-10-05 10:08:19
# 问题已解决 谢谢
```
//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<stack>
#include<string>
#include<map>
#include<cstdlib>
#include<queue>
#include<math.h>
#include<time.h>
#include<cstdio>
#include<stdio.h>
#include<algorithm>
using namespace std;
/*
【问题简述】给你 n(n≤24)根火柴棍,你可以拼出多少
个形如“A+B=C”的等式?等式中的 A、B、C 是用火柴棍
拼出的整数(若该数非零,则最高位不能是 0),数字的形状
和电子表上的一样。
注意:
1.加号与等号各自需要两根火柴棍。
2.如果 A≠B,则A+B=C与B+A=C视为不同的等式(A,B,C≥0)。
3.n根火柴棍必须全部用上。
*/
int cnt=0;
int n,c[11]={6,2,5,5,4,5,6,3,7,6};
inline int read(){
int ans=0,flag=1;
char ch=getchar();
while((ch>'9'||ch<'0')&&ch!='-') ch=getchar();
if(ch=='-') flag=-1,ch=getchar();
while(ch>='0'&&ch<='9'){
ans=ans*10+ch-'0';
ch=getchar();
}
return ans*flag;
}
int match(int x){
if(x==0) return 6;
int ans=0;
while(x){
ans+=c[x%10];
x/=10;
}
return ans;
}
int main(){
n=read();
for(int i=0;i<=2000;i++)//改成2000就可以啦。。
for(int j=0;j<=2000;j++)//这里好尴尬啊
if(match(i)+match(j)+match(i+j)+4==n)
cnt++;
printf("%d\n",cnt);
return 0;
}
```
by fzj2007 @ 2019-10-05 10:10:59
#include<iostream>
using namespace std;
int sum,sz[10]={6,2,5,5,4,5,6,3,7,6},n,h[1000];
void pd(int,int,int);
int main()
{
cin>>n;
for(int i=0;i<=333;i++)
for(int j=0;j<=333;j++)
for(int z=0;z<=333;z++)
{
if(i+j==z)
{
pd(i,j,z);
}
}
cout<<sum;
return 0;
}
void pd(int a,int b,int c)
{
int sa,sb,sc;
if(a<=9)
sa=sz[a];
else if(a<=99&&a>=10)
sa=sz[a/10]+sz[a%10];
else if(100<=a)
sa=sz[a/100]+sz[a%10]+sz[a%100/10];
if(b<=9)
sb=sz[b];
else if(b<=99&&b>=10)
sb=sz[b/10]+sz[b%10];
else if(100<=b)
sb=sz[b/100]+sz[b%10]+sz[b%100/10];
if(c<=9)
sc=sz[c];
else if(c<=99&&c>=10)
sc=sz[c/10]+sz[c%10];
else if(100<=c)
sc=sz[c/100]+sz[c%10]+sz[c%100/10];
if(sa+sb+sc==n-4)
{
sum++;
}
}
by yyewenh @ 2019-10-05 11:18:38
为啥我也是第4个124
by yyewenh @ 2019-10-05 11:19:02
考古(
by UperFicial @ 2020-09-28 12:20:07