更新 '2.5.cpp'
This commit is contained in:
parent
37b51e3775
commit
67f514a15c
12
2.5.cpp
12
2.5.cpp
|
@ -44,6 +44,17 @@ int main()
|
|||
});
|
||||
});
|
||||
|
||||
conn.exec("use bigdata5",nullptr);
|
||||
conn.exec("select job_city,count(*) from pages where ( title like '%大数据%' ) group by job_city",[&](MySQLResult& res)
|
||||
{
|
||||
res.stepRow([&](char** val,unsigned long* len)
|
||||
{
|
||||
string city(val[0]);
|
||||
int cc=ParseInt(val[1]);
|
||||
mp[Trim(city)].push_back(cc);
|
||||
});
|
||||
});
|
||||
|
||||
ofstream ofs("result/2.5.csv");
|
||||
|
||||
for(auto iter=mp.begin();iter!=mp.end(); )
|
||||
|
@ -76,6 +87,7 @@ int main()
|
|||
|
||||
#define cout ofs
|
||||
|
||||
cout<<"城市,大数据岗位数量"<<endl;
|
||||
for(auto& pr:mp)
|
||||
{
|
||||
cout<<pr.first<<",";
|
||||
|
|
Reference in New Issue
Block a user