补充一下,有的情况还有遗漏,如样例2时n=18的情况-_-||
by Noldo @ 2024-03-14 16:35:33
@[Noldo](/user/1179393) 试下把Nums函数中的
```cpp
while (n % 10 != 0)
```
改成
```cpp
while (n != 0)
```
by o7u7o @ 2024-03-14 17:18:15
@[Noldo](/user/1179393)
#include<iostream>```cpp
```
using namespace std;
int a[2010] = {6},c[10]= {6,2,5,5,4,5,6,3,7,6};
int main()
{
int s = 0,l;
scanf("%d",&l);
for(int i = 1;i <= 2000;i++)
{
int j = i;
while(j >= 1)
{
a[i] = a[i] + c[j % 10];
j = j / 10;
}
}
for(int i = 0;i <= 1000;i++)
for(int j = 0;j <= 1000;j++)
if((a[i] + a[j] + a[i + j] + 4) == l)
s++;
printf("%d\n",s);
return 0;
}
by Hammer2048 @ 2024-03-16 20:29:17
**int tran(int num)
{
int res=0;
string name=to_string(num);
for(int i=0;i<name.size();i++)
res+=q[name[i]-'0'];
return res;
}**
by Earlyzzy @ 2024-05-03 07:54:56