更新 '3.3.cpp'

master
Kirigaya Kazuto 2017-09-17 21:09:32 +08:00
parent 2e6af953f7
commit c5d0f8a433
1 changed files with 12 additions and 0 deletions

12
3.3.cpp
View File

@ -91,6 +91,17 @@ int main()
});
});
conn.exec("use bigdata2",nullptr);
conn.exec("select title,count(*) as want_num from pages where ( title like '%大数据%' ) group by title order by want_num desc",[&](MySQLResult& res)
{
res.stepRow([&](char** val,unsigned long* len)
{
string city(val[0]);
int cc=ParseInt(val[1]);
dmp[Trim(city)].push_back(cc);
});
});
fn1(dmp);
vector<pair<string,int>> vec;
@ -105,6 +116,7 @@ int main()
ofstream ofs("result/3.3.csv");
#define cout ofs
cout<<"岗位名称,需求量"<<endl;
int szLoop=min(10u,vec.size());
for(int i=0;i<szLoop;i++)
{