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

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

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

    userId_undefined

    魔丸

    秩序白银
    25阅读
    0回复
    1点赞
  • 题解

    #include <bits/stdc++.h> using namespace std; int main() { int a[4] = {0}, tmp; for (int i = 1; i <= 3; i++) { cin >> tmp; a[i] = tmp; } sort(a, a + 4); cout << a[3] - a[1]; }

    userId_undefined

    极乐教的磨磨头

    倔强青铜
    8阅读
    1回复
    2点赞
  • 奶浓基岩病毒

    #include<bits/stdc++.h> using namespace std; int main(){ int a[4]={0},tmp; for(int i=1;i<=3;i++){ cin>>tmp; a[i]=tmp; } sort(a,a+4); cout<<a[3]-a[1]; }

    userId_undefined

    mktgzjesw yhn,k

    倔强青铜
    5阅读
    1回复
    2点赞
  • 题解

    userId_undefined

    zsy

    秩序白银
    20阅读
    0回复
    0点赞
  • # 官方题解|欢乐赛#41 T2

    T2.差值最大 题目思路 本题的思路是选出三个数的最大值和最小值,进行做差即可,实现的方法有很多,比如可以三个数轮流比较,也可以进行排序,也可以利用C++STL容器进行求解。 参考代码

    userId_undefined

    桌子乱的反义词

    荣耀黄金
    17阅读
    0回复
    0点赞
  • 简单,max-min

    #include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; cout<<max(a,max(b,c))-min(a,min(b,c)); return 0; }

    userId_undefined

    天之神——申博源

    荣耀黄金
    9阅读
    0回复
    0点赞
  • 题解

    #include<iostream> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; if(a<b){ swap(a,b); } if(b<c){ swap(b,c); } if(a<b){ swap(a,b); } cout<<a-c; return 0; }

    userId_undefined

    LS_YZY

    倔强青铜
    0阅读
    0回复
    0点赞
首页