You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
554 B
35 lines
554 B
#include<bits/stdc++.h>
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int a[10]= {6,2,5,5,4,5,6,3,7,6},ans=0,temp=0,k;
|
|
int num[2016];
|
|
int n;
|
|
cin>>n;
|
|
num[0]=6;
|
|
for(int i=1; i<=2000; i++) {
|
|
k=i;
|
|
while(k) {
|
|
temp+=a[k%10];
|
|
k/=10;
|
|
}
|
|
num[i]=temp;
|
|
temp=0;
|
|
}
|
|
for(int i=0; i<=999; i++)
|
|
for(int j=0; j<=999; j++) {
|
|
if(num[i]+num[j]>=n)
|
|
continue;
|
|
else {
|
|
if(num[i+j]+num[i]+num[j]+4==n) {
|
|
ans++;
|
|
cout<<i<<"["<<num[i]<<"]"<<"+"<<j<<"["<<num[j]<<"]"<<"="<<i+j<<"["<<num[i+j]<<"]"<<endl;
|
|
}
|
|
}
|
|
}
|
|
cout<<ans;
|
|
return 0;
|
|
}
|
|
|
|
|