答案:1905
#include<iostream>
#include<algorithm>
#include<set>
#define M 59084709587505
using namespace std;
int main(){
int arr[3] = {3, 5, 7};
long long number = 1;
set<long long>num;
while(1){
for(int i = 0; i < 3; i++){
long long tt = number*arr[i];
if(tt<=M){
num.insert(tt);
}
}
number = *num.upper_bound(number);
if(number ==M) break;
}
cout<<num.size();
}
注意容器的upper_bound(num)方法,返回的是容器中第一个比num大的元素的位置,是指针类型。