3 comments

  • @ 2025-11-10 13:20:01
    #include <iostream>
    #include <cstdio>
    using namespace std;
    int main(){
    	double a,b,c;
    	cin >> a >> b >> c;
    	if (a > b){
    		if (a > c){
    			if (b > c)cout << c << ' ' << b << ' ' << a;
    			else cout << b << ' ' << c << ' ' << a;
    		}
    		else{
    			cout << a << ' ' << c << ' ' << b;
    		}
    	}
    	else{
    		if (a > c){
    			cout << c << ' ' << a << ' ' << b;
    		}
    		else{
    			if (b > c)cout << a << ' ' << c << ' ' << b;
    			else cout << a << ' ' << b << ' ' << c;
    		}
    	}
    	system ("pause");
    	return 0;
    }
    
    • @ 2025-11-5 17:11:03

      我也秀一下我的

      #include<cstdio>
      #include<iostream>
      #include<algorithm>
      using namespace std;
      double horse[10001]={};
      int n=0;
      int main()
      {
      	while(scanf("%lf",&horse[n++])==1);
      	sort(horse,horse+n);
      	for(int i=1;i<n;++i)
      		cout<<horse[i]<<' ';
      	return 0; 
      }
      
      • @ 2025-11-5 13:11:59

        给大家看看当年我T1的代码

        //当时差点栽这了
        #include<bits/stdc++.h>
        using namespace std;
        double s[2];
        bool su(double &a,double &b){
        	if(a<b) return true;
        	return false;
        }
        int main(){
        	for(int i=0;i<3;i++){
        		cin>>s[i];
        	}
        	sort(s,s+2,su);
        	for(int i=0;i<3;i++){
        		cout<<s[i]<<" ";
        	}
        	return 0;
        }
        

        不要笑挑战

        • 1