acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
  • 竞赛
  • 讨论
  • 团队
  • 商城
登录
注册
题目详情提交记录(0)
  • 题解

    userId_undefined
    ???
    题解仙人字符串·魔法使时空双修者出道萌新GESP3级模拟·模拟练习生
    109阅读
    1回复
    5点赞
  • 题解

    userId_undefined
    zsy
    题解仙人时空双修者快乐小狗BUG超度大师秩序白银
    65阅读
    0回复
    2点赞
  • 适合新手的简易版题解

    #include<bits/stdc++.h> using namespace std; struct paidui { double ti; int id; }; bool cmp(paidui a,paidui b) { if(a.ti == b.ti) return a.id < b.id; return a.ti < b.ti; } paidui a[1010]; int main() { int n; double cnt = 0; cin >> n; for(int i = 1; i <= n; i++) { cin >> a[i].ti; a[i].id = i; } sort(a+1,a+n+1,cmp); for(int i = 1; i <= n; i++) { cout << a[i].id << " "; for(int j = i-1; j >= 1; j--) { cnt += a[j].ti; } } cout << endl; cnt /= n; cout << fixed << setprecision(2) << cnt; return 0; }

    userId_undefined
    WERT
    循环·循环打卡人时间刺客空间掌握者时空双修者倔强青铜
    39阅读
    0回复
    3点赞
  • 题解

    userId_undefined
    LS_YZY
    题解仙人出道萌新时空双修者倔强青铜模拟·模拟练习生快乐小狗
    29阅读
    0回复
    1点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页