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

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

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

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

    #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
    倔强青铜快乐小狗时空双修者俄罗斯套娃大师循环·循环打卡人
    59阅读
    3回复
    4点赞
  • 题解

    userId_undefined
    zsy
    秩序白银时空双修者题解仙人快乐小狗BUG超度大师
    69阅读
    0回复
    2点赞
  • 题解

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

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

首页