看不懂 输入三个整数 从小到大排列 看不懂意思 #includeusing namespace std;int main

学习 时间:2026-04-07 22:54:29 阅读:4784
看不懂 输入三个整数 从小到大排列 看不懂意思 #includeusing namespace std;int main(){int tmp[4];int a=0,b=0,c=0;cin >>a >> b >> c;tmp[0]=a;tmp[1]=b;tmp[2]=c;tmp[3]=-1;for(int i=1;i=i;j--){if(tmp[j]

最佳回答

懵懂的老师

典雅的唇膏

2026-04-07 22:54:29

这个程序是用冒泡法排序,只不过它是由最后往前冒。#includeusing namespace std;int main(){int tmp[4];int a=0,b=0,c=0;cin >>a >> b >> c;tmp[0]=a; //tmp数组有4个元素,其中第四个tmp[3]是辅助用人的tmp[1]=b;tmp[2]=c;tmp[3]=-1;for(int i=1;i=i;j--) //排序由数组的最后往前做冒泡排序{if(tmp[j]

最新回答共有2条回答

  • 害怕的铃铛
    回复
    2026-04-07 22:54:29

    这个程序是用冒泡法排序,只不过它是由最后往前冒。#includeusing namespace std;int main(){int tmp[4];int a=0,b=0,c=0;cin >>a >> b >> c;tmp[0]=a; //tmp数组有4个元素,其中第四个tmp[3]是辅助用人的tmp[1]=b;tmp[2]=c;tmp[3]=-1;for(int i=1;i=i;j--) //排序由数组的最后往前做冒泡排序{if(tmp[j]

上一篇 there is much ----(pollute)in the lake. the box is much too

下一篇 书,是我生命的一部分.怎么理解