当前位置: 首页 > news >正文

网站建设视频教学卓拙科技做网站吗

网站建设视频教学,卓拙科技做网站吗,网站建设佛山拓客科技公司,深圳做营销网站制作一#xff0e;题意 一个员工是另外一个员工的老板必须满足的条件是作为老板的员工的薪水salary必须大于这个员工#xff0c;而且作为老板的员工的身高height要大于等于这个员工。首先按照薪水的多少从小到大进行排序#xff0c;然后找每一个员工的直属老板。注意老板的下属的…一题意 一个员工是另外一个员工的老板必须满足的条件是作为老板的员工的薪水salary必须大于这个员工而且作为老板的员工的身高height要大于等于这个员工。首先按照薪水的多少从小到大进行排序然后找每一个员工的直属老板。注意老板的下属的数量为其下属的下属之和。 二用结构体。为了方便查询再加设一个按id号排序的数组。 三. 注意员工老板的后代包括这些员工后代的和。每次vector都要清空一次。 四. 代码 1 //2 // main.cpp3 // sicily-10634 //5 // Created by ashley on 14-10-13.6 // Copyright (c) 2014年 ashley. All rights reserved.7 //8 9 #include iostream 10 #include vector 11 #include algorithm 12 using namespace std; 13 typedef struct 14 { 15 int idNumber; 16 int salary; 17 int height; 18 int bossId; 19 int subordinates; 20 }employee; 21 vectoremployee allEmployees; 22 employee sortByID[1000000]; 23 int query[200]; 24 bool compare(employee left, employee right) 25 { 26 return left.salary right.salary; 27 } 28 int main(int argc, const char * argv[]) 29 { 30 int cases; 31 int employeeCounter, queryCounter; 32 int id, sal, hei; 33 cin cases; 34 while (cases--) { 35 allEmployees.clear(); 36 cin employeeCounter queryCounter; 37 for (int i 0; i employeeCounter; i) { 38 cin id sal hei; 39 allEmployees.push_back(employee{id, sal, hei, 0, 0}); 40 } 41 for (int i 0; i queryCounter; i) { 42 cin query[i]; 43 } 44 sort(allEmployees.begin(), allEmployees.begin() employeeCounter, compare); 45 //找boss 46 for (int i 0; i employeeCounter; i) { 47 int key -1; 48 for (int j i 1; j employeeCounter; j) { 49 if (allEmployees[j].height allEmployees[i].height) { 50 key j; 51 break; 52 } 53 } 54 if (key ! -1) { 55 allEmployees[i].bossId allEmployees[key].idNumber; 56 allEmployees[key].subordinates allEmployees[key].subordinates allEmployees[i].subordinates 1; 57 } 58 sortByID[allEmployees[i].idNumber] allEmployees[i]; 59 } 60 for (int i 0; i queryCounter; i) { 61 cout sortByID[query[i]].bossId sortByID[query[i]].subordinates endl; 62 } 63 } 64 return 0; 65 }  转载于:https://www.cnblogs.com/ashley-/p/4151817.html
http://www.zqtcl.cn/news/793885/

相关文章:

  • 做自己的卡盟网站做技术一般逛那些网站
  • 网站建设自学多长时间做网站原型的软件
  • 营销型的物流网站模板北京楼市最新消息
  • 宁波模版建站公司湘潭建设网站公司
  • 世界十大网站排名出炉最新军事新闻最新消息视频
  • 医疗电子的网站建设城市建设管理
  • win10建站wordpress商城网站结算页面怎么做
  • 电商网站模板引擎惠阳做网站公司
  • 如何在百度做网站推广中企动力企业邮箱手机邮箱
  • extjs做的网站开发公司宣传语
  • 长安做外贸网站关于阅读类网站的建设规划书
  • php网站建设思路方案阿里巴巴如何建设网站
  • 网站做什么推广好网站域名注册步骤
  • 官方建网站有哪些步骤国内成熟的crm系统
  • 建设银行深圳天健世纪支行网站电子商务网站建设员
  • 个人备案域名可以做企业网站吗海南做公司网站
  • 浙江坤宇建设有限公司网站施工企业施工生产计划
  • 成都建站推广域名备案用的网站建设方案
  • 西安市城乡建设管理局网站6一级域名生成二级域名
  • 网站建设沙漠风服装公司网站源码
  • 体检营销型网站php网站建设培训班
  • 做洁具最好的网站数据分析
  • 郑州网站建设丶汉狮网络网站建设中图片是什么意思
  • 深圳网站建设公司设计公司做影视网站用主机还是用服务器
  • 网站建设价格如何做问卷调查网站
  • 网络营销推广合同天津网站seo策划
  • 明年做那个网站致富wordpress loper
  • 网站开发原理柳州网站推广
  • 杭州高端网站开发重庆网站建设去迅法网
  • 营销型网站建设调查表用flash做游戏下载网站