acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 病人看病

    #include<bits/stdc++.h> using namespace std; struct patient{ }p[109]; bool cmp(patient a,patient b) { if(a.age<60 && b.age < 60) return a.order<b.order; else if(a.age>=60 && b.age >=60) { if(a.age ==b.age) } int main() { int n; cin >> n; for(int i=1;i<=n ;i++) { cin>>p[i].id >> p[i].age; p[i].order = i; } sort(p+1,p+n+1,cmp); for(int i =1;i <= n; i++) cout << p[i].id << endl; return 0; }

    userId_undefined

    リンク

    120阅读
    0回复
    3点赞
  • 新鲜出炉的解题

    (包对的,老师教的)

    userId_undefined

    快被c++哄睡着了#

    枚举·枚举小能手递归·套娃学徒出道萌新倔强青铜
    84阅读
    0回复
    0点赞
  • ti jie

    userId_undefined

    一只雪梨

    26阅读
    3回复
    4点赞
  • 解题

    学习系统与acgo都过了 程序: #include<bits/stdc++.h> using namespace std; struct patient{ string id; int age,order; }p[109]; bool cmp(patient a,patient b){ if(a.age<60 && b.age < 60){ return a.order<b.order; }else if(a.age>=60 && b.age >=60){ if(a.age ==b.age){ return a.order < b.order; }else{ return a.age > b.age; } }else{ return a.age > b.age; } } int main(){ int n; cin >> n; for(int i=1;i<=n ;i++){ cin>>p[i].id >> p[i].age; p[i].order = i; } sort(p+1,p+n+1,cmp); for(int i =1;i <= n; i++){ cout << p[i].id << endl; } return 0; } 自行缩进

    userId_undefined

    133****0156

    48阅读
    0回复
    0点赞
  • 题解来啦(带缩进的哟)

    userId_undefined

    李赛科

    30阅读
    0回复
    0点赞
  • 题解

    userId_undefined

    zsy

    题解仙人7月全勤卷王出道萌新时间刺客时空双修者秩序白银
    13阅读
    0回复
    0点赞
  • 29行,不用慌

    userId_undefined

    一念成魔

    字符串·魔法使循环·循环打卡人分支·分支解题者I/O·IO入门者模拟·模拟练习生
    2阅读
    0回复
    1点赞
  • A30609.病人排队 题解

    经典的结构体排序

    userId_undefined

    skirmish

    时间刺客时空双修者空间掌握者出道萌新秩序白银
    3阅读
    0回复
    0点赞
首页