题目描述:
定义一个数字为幸运数字当且仅当它的所有数位都是4或者7。
比如说,47、744、4都是幸运数字而5、17、467都不是。
定义next(x)为大于等于x的第一个幸运数字。给定l,r,请求出next(l) + next(l + 1) + … + next(r - 1) + next®。
输入描述:
两个整数l和r (1 <= l <= r <= 1000,000,000)。
输出描述:
一个数字表示答案。
输入:
2 7
7 7
输出:
33
7
题意:
题目描述
题解:
深搜
先找出来所有所有只有4和7的数
然后计算
比如47~74之间(不含47)的数都算作74,那有多少个数?就是74-47+1,然后直接乘74,加起来就ok了
代码:
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
typedef long long ll;
const</