#include "iostream"
#include "set"
using namespace std;
int main()
{
set<int> s;
set<int>::iterator it;
int temp;
while (cin >> temp && temp != -1)
{
if (temp != 0)
s.insert(temp);//放进容器中进行自动排序!
else
{
int count = 0;
for (it = s.begin(); it != s.end(); it++)
if (s.find((*it) * 2) != s.end())//在容器中查找是否存在!
count++;
cout << count << endl;
s.clear();
}
}
}
zoj 1760 Doubles
最新推荐文章于 2021-09-16 11:04:39 发布