题目:
题解:
#include<iostream>
#include<map>
#include<cmath>
using namespace std;
map<int,int>mp;
int main()
{
int x;
cin>>x;
double key; //记录每一轮计算的值
for(int i=1;i<=x;i++)
{
key=abs(i/2)+abs(i/3)+abs(i/5);
mp[key]++;
}
int count=0; //计数不同值的个数
for(int i=0;i<=2*x;i++)
{
if(mp[i]>0)
{
count++;
}
}
cout<<count;
return 0;
}
标签:PAT,cout,int,题解,namespace,乙级,include,刷题
From: https://blog.csdn.net/2301_79580018/article/details/139278824